[gdal-dev] ogr2ogr PG->SHP lacks EPSG code

Even Rouault even.rouault at spatialys.com
Fri Nov 11 09:56:37 PST 2016


Le vendredi 11 novembre 2016 16:53:02, Martin Landa a écrit :
> Hi,
> 
> when trying to convert PostGIS data to Shapefiles I discovered strange
> issue. Input data:
> 
> ogrinfo "PG:dbname=gismentors" ruian.kraje  -so
> ..
> Layer SRS WKT:
> PROJCS["S-JTSK / Krovak East North",
>     GEOGCS["S-JTSK",
>         DATUM["System_Jednotne_Trigonometricke_Site_Katastralni",
>             SPHEROID["Bessel 1841",6377397.155,299.1528128,
>                 AUTHORITY["EPSG","7004"]],
>             TOWGS84[570.8,85.7,462.8,4.998,1.587,5.261,3.56],
>             AUTHORITY["EPSG","6156"]],
>         PRIMEM["Greenwich",0,
>             AUTHORITY["EPSG","8901"]],
>         UNIT["degree",0.0174532925199433,
>             AUTHORITY["EPSG","9122"]],
>         AUTHORITY["EPSG","4156"]],
>     PROJECTION["Krovak"],
>     AUTHORITY["EPSG","5514"]]
> ...
> 
> After conversion done by:
> 
> ogr2ogr -f 'ESRI Shapefile' -lco 'ENCODING=UTF-8' kraje.shp
> "PG:dbname=gismentors" ruian.kraje
> 
> EPSG codes (5514) disappears:
> 
> ogrinfo  kraje.shp kraje -so
> ...
> Layer SRS WKT:
> PROJCS["S_JTSK_Krovak_East_North",
>     GEOGCS["GCS_S-JTSK",
>         DATUM["System_Jednotne_Trigonometricke_Site_Katastralni",
>             SPHEROID["Bessel_1841",6377397.155,299.1528128]],
>         PRIMEM["Greenwich",0],
>         UNIT["Degree",0.017453292519943295]],
>     PROJECTION["Krovak"],
>     PARAMETER["latitude_of_center",49.5],
>     PARAMETER["longitude_of_center",24.83333333333333],
>     PARAMETER["azimuth",30.28813972222222],
>     PARAMETER["pseudo_standard_parallel_1",78.5],
>     PARAMETER["scale_factor",0.9999],
>     PARAMETER["false_easting",0],
>     PARAMETER["false_northing",0],
>     UNIT["Meter",1]]
> 
> Any idea what could be wrong? Thanks! Martin

The WKT variant of ESRI Shapefile .prj doesn't have EPSG codes (nor TOWGS84 
node by the way). At least that was how it was historically and GDAL "morphs" 
OGC WKT to ESRI WKT this way (there are other variations in names of 
projection methods and parameters). Regarding the EPSG code, for some reason, 
I believe this might perhaps have changed in recent ArcGIS versions but I'm 
not sure. Perhaps someone could confirm


-- 
Spatialys - Geospatial professional services
http://www.spatialys.com


More information about the gdal-dev mailing list