[postgis-users] Differences in st_transform between Postgis 2.3 and Postgis 3.0

David McKelvie dmck at interactive.co.uk
Thu Apr 23 05:25:14 PDT 2020


Ive noticed a difference between the results returned by st_transform
between Postgis 2.3 and Postgis 3.0 and wonder if anyone on this list
might be able to explain why that is so.

I have a home rolled entry in the spatial_ref_sys table for a SRID called
927700.  This is the UK Ordnance Survey coordinate system using OSTN02.

The spatial_ref_sys.proj4text for this is
(newline added for readability)

'+proj=tmerc +lat_0=49 +lon_0=-2 +k=0.9996012717 +x_0=400000
+y_0=-100000 +ellps=airy +units=m +no_defs +nadgrids=OSTN02_NTv2.gsb'

So it is using a gsb data file.

The following query shows a difference
converting a point in 4326 'WGS 84' to 927700 "OSGB 1936 / British National Grid"

SELECT st_asewkt(st_transform(geomfromEWKT(
   'SRID=4326;POINT(-0.077731 54.116851 86.778)'
), 927700)) AS a;

postgres / postgis     result
9.6  / 2.3  SRID=927700;POINT(525745.680454343 470703.162768111 86.778)
9.6  / 3.0  SRID=927700;POINT(525744.779056573 470705.423178893 86.778)

A difference of -0.901 2.26 which is quite significant given that OSGB
is measured in meters.

Any ideas what is going on?

David McKelvie

More information about the postgis-users mailing list