[postgis-devel] Geography <-> Geometry casts

Paul Ramsey pramsey at opengeo.org
Wed Jan 11 07:33:23 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.

On Wed, Jan 11, 2012 at 6:40 AM, Sandro Santilli <strk at keybit.net> wrote:
> Can anyone please explain why we have an IMPLICIT geometry->geography
> cast while we don't have geography->geometry as IMPLICIT ?
>
> The most convincing explanation I got so far arrived from Regina
> mentioning it had to do with queries of the form:
>
>  Geography && Geometry
>
> becoming ambiguos.
>
> If that's the only reason, wouldn't it be the same if we made the
> Geography->Geometry IMPLICIT rather than the other way around ?
> I can see it won't help the && case but would help all the others
> like ST_AsBinary, GeometryType etc.
>
> The examples above (AsBinary, GeometryType) come from qgis code.
>
> I'm about to add wrappers for ST_AsBinary(geography) to avoid
> touching client code expecting that to work, but doing so by
> extension would mean overriding each and every geometry function.
>
> Isn't it more common to threat a geography as a geometry rather
> than the other way around, in absence of overrides ?
>
> --strk;
>
>  ()   Free GIS & Flash consultant/developer
>  /\   http://strk.keybit.net/services.html
> _______________________________________________
> postgis-devel mailing list
> postgis-devel at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-devel



More information about the postgis-devel mailing list