"Casting" Between Types

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

"Casting" Between Types

Paul Ramsey
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.

ATB,
P

_______________________________________________
postgis-devel mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/postgis-devel

casting.pdf (70K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: "Casting" Between Types

Stephen Woodbridge
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?


---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus

_______________________________________________
postgis-devel mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/postgis-devel
Reply | Threaded
Open this post in threaded view
|

Re: "Casting" Between Types

Paul Ramsey
On Mon, Jul 18, 2016 at 6:46 AM, Stephen Woodbridge <[hidden email]> 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

P
 


---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus

_______________________________________________
postgis-devel mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/postgis-devel


_______________________________________________
postgis-devel mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/postgis-devel
Reply | Threaded
Open this post in threaded view
|

Re: "Casting" Between Types

Even Rouault-2
Le lundi 18 juillet 2016 15:55:50, Paul Ramsey a écrit :

> On Mon, Jul 18, 2016 at 6:46 AM, Stephen Woodbridge
> <[hidden email]
>
> > 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) :
http://www.geopackage.org/spec/#geometry_types


--
Spatialys - Geospatial professional services
http://www.spatialys.com
_______________________________________________
postgis-devel mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/postgis-devel