[postgis-devel] Geography <-> Geometry casts

Paragon Corporation lr at pcorp.us
Thu Jan 12 05:12:29 PST 2012


> Yes, an implicit geography->geometry cast would be much more 
> useful than the reverse. I have no recollection of the 
> reasons why we don't have it, but I'm sure there's a good one.
> P.

I really hope this line of thinking is over, but in case it is not.
Here is an example why autocasting from geography -> geometry is bad bad
bad.  Note since
most geometry functions are overloaded in geography, its not quite so much
of an issue as you 
are unlikely to run into logical confusing cases like this example: 

Example: If we have auto casting between geography -> geometry

and I do:

SELECT ST_Union(geography)

...

Yikes, I get back a geometry object.  How on earth are you going to explain
why ST_Buffer(geography) --> geography

and:
ST_Union(geography) --> geometry

Thanks,
Regina






More information about the postgis-devel mailing list