[postgis-users] Wrong spatial_sys_ref definitions in postgis 2.3?

Sergio Segala sergio.segala.list at gmail.com
Mon Feb 6 00:24:51 PST 2017


Hi to all,

I use very often the following EPSG codes, which seems to have a wrong 
definition inside postgis 2.3:
31254, 31255, 31256, 31257, 31258, 31259, 31466.31467, 31468, 31469
In particular the "towgs84" part in the field proj4text of the table 
spatial_sys_ref is missing, and doesn't match with the srtext field 
(which seems to contains the propely towgs84 parameters).

For example the definition of the srid 31258 is:
Actual srtext definition: 'PROJCS["MGI / Austria GK 
M31",GEOGCS["MGI",DATUM["Militar_Geographische_Institute",SPHEROID["Bessel 
1841",6377397.155,299.1528128,AUTHORITY["EPSG","7004"]],TOWGS84[577.326,90.129,463.919,5.137,1.474,5.297,2.4232],AUTHORITY["EPSG","6312"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.0174532925199433,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","4312"]],UNIT["metre",1,AUTHORITY["EPSG","9001"]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",13.33333333333333],PARAMETER["scale_factor",1],PARAMETER["false_easting",450000],PARAMETER["false_northing",-5000000],AUTHORITY["EPSG","31258"],AXIS["X",NORTH],AXIS["Y",EAST]]'
Actual proj4text definition: +proj=tmerc +lat_0=0 
+lon_0=13.33333333333333 +k=1 +x_0=450000 +y_0=-5000000 
+datum=hermannskogel +units=m +no_defs
Correct proj4text definition: +proj=tmerc +lat_0=0 
+lon_0=13.33333333333333 +k=1 +x_0=450000 +y_0=-5000000 +ellps=bessel 
+towgs84=577.326,90.129,463.919,5.137,1.474,5.297,2.4232 +units=m +no_defs

I'd a look on spatialreference.org, on postgis 2.1 and on qGis and I'm 
quite confusing, because there are different definitions:
spatialreference.org: no towgs84 definitions at all
postgis 2.1 and qGis: right definition
postgis 2.3: bad definition

Has anybody the same issue? How did he solved it?
I changed the postgis--2.3.0.sql file, which contains the postgis 
statement executed on CREATE EXTENSION, to fix the definition for the 
new databases, but I think it will be replaced on a package update, so 
is there a better solution?
Where postgis get the spatial_ref_sys definition?

Thanks a lot,

Sergio


More information about the postgis-users mailing list