[postgis-devel] "Casting" Between Types

Even Rouault even.rouault at spatialys.com
Mon Jul 18 07:48:44 PDT 2016

Le lundi 18 juillet 2016 15:55:50, Paul Ramsey a écrit :
> On Mon, Jul 18, 2016 at 6:46 AM, Stephen Woodbridge
> <woodbri at swoodbridge.com
> > wrote:
> > 
> > On 7/18/2016 9:40 AM, Paul Ramsey wrote:
> >> I found this page by accident in the SQL/MM doco this morning and it
> >> tickled my interest. Basically it describes when one should allow
> >> equivalence between types (I guess if one has modelled spatial in the DB
> >> as 21 different types, it strictly is "casting", but nobody has done
> >> that).
> >> 
> >> What I find pleasant is it's an official page that says "hey, don't be
> >> anal retentive losers about allowing single-ton multi-geometries to pass
> >> as singletons", which would be a nice improvement. In general, having a
> >> bit more knowledge of the geometry class structure would probably make
> >> things nicer (so the "type" restriction could be smarter and a polygon
> >> could be inserted into a multi-polygon column).
> >> 
> >> Anyways, just random thoughts for the moment.
> > 
> > And things like st_startpoint() and linear refering functions, etc
> > would/should behave nicely when passed a singleton multilinestring?
> yes, exactly, it's a nit which has been bugging me for a while, but it was
> there "to be correct" and since there's this nice alternative reference of
> correctness, I thought I'd bring it up

GeoPackage has a similar concept of "assignable" geometry types to define which 
geometries can be inserted into a geometry column of a given type, but it is 
strictly based on the SFA inheritance diagram (so doesn't allow single<--
>multi assignation) :

Spatialys - Geospatial professional services

More information about the postgis-devel mailing list