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

J Smith dark.panda+lists at gmail.com
Tue Feb 21 13:57:41 PST 2017


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



More information about the postgis-devel mailing list