[postgis-devel] Operations on mixed geometries in geography types

Paul Ramsey pramsey at cleverelephant.ca
Tue Feb 21 14:07:38 PST 2017


Change your tests. Early versions of geography were 4326-only, but it's now
possible to have other geographic SRIDs

P

On Tue, Feb 21, 2017 at 1:57 PM, J Smith <dark.panda+lists at gmail.com> wrote:

> G'day list.
>
> I was just updating some code recently that had some unit tests that
> tested some operations on geography columns and noticed that between
> PostGIS 2.1 and 2.2 the following query gives different results:
>
> SELECT ST_covers('SRID=4326;POLYGON((5 5,5 10,10 10,10 5,5
> 5))'::geography, 'SRID=4269;POINT(7 7)'::geography);
>
> On PostGIS 2.1 we get true, but on 2.2+ it errors out with "ERROR:
> XX000: Operation on mixed SRID geometries".
>
> I haven't been using PostGIS on any projects recently so I might be a
> bit behind the times, but is this expected behaviour? I would have
> assumed that SRID isn't really used on geography types and figured
> that everything would be coerced or otherwise transformed to 4326
> anyways.
>
> Is this new behaviour expected, or should I change my unit tests and
> code to match the new behaviour?
>
> Cheers
> _______________________________________________
> postgis-devel mailing list
> postgis-devel at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/postgis-devel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-devel/attachments/20170221/147b8185/attachment.html>


More information about the postgis-devel mailing list