[gdal-dev] [Non-DoD Source] Re: ogr not reading the prj file

jratike80 jukka.rahkonen at maanmittauslaitos.fi
Tue Jan 22 09:58:49 PST 2019


TUELLER, SHAYNE R CIV USAF AFMC 519 SMXS/MXDEC wrote
> I should also mention that when using gdal 1.11, I didn't have to
> explicitly set the GDAL_DATA environment variable in order for the SRS
> info to print out. With gdal 2.3.1, if I don't set the GDAL_DATA variable,
> I get the following error...
> 
> ERROR 4: Unable to open EPSG support file gcs.csv. Try setting the
> GDAL_DATA environment variable to point to the directory containing EPSG
> csv files.
> 
> Not sure why I don't need this dependency in gdal 1.11. With this version
> it just loads the SRS info found in my prj file which is what I want.
> 
> Shayne

Hi,

Please read the previous answers and try to understand what happens.
- ESRI is using its own version of WKT that is slightly different from the
OGC version. With your .prj the main difference is in the name of the DATUM:
"D_WGS_1984".
- GDAL reads the ESRI variant and if it finds corresponding OGC WKT it
prints that by default.
- The older GDAL version probably did not find the hit. You should
experiense the same with GDAL 2.3.1 if you edit your .prj file a bit so that
it will not find corresponding definitions from the EPSG data in GDAL_DATA
directory

GEOGCS["GCS_WGS_FOO", DATUM["FOO_WGS_1984", SPHEROID["WGS_1984", 6378137,
298.257223563]],PRIMEM["Greenwich",0],UNIT["Degree",0.017453292519943295]]

You did not explain yet what real problem you have due to gdalinfo reporting
OGC WKT instead of ESRI WKT. Both mean just the same for GDAL.

If you want to see the ESRI WKT you can use gdalsrsinfo. I saved your .prj
as test.prj and here is the result. Even "SPHERIOD" is remained.

gdalsrsinfo test.prj -o wkt_esri
GEOGCS["GCS_WGS_1984",DATUM["D_WGS_1984",SPHERIOD["WGS_1984",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["Degree",0.017453292519943295]]

-Jukka Rahkonen-



--
Sent from: http://osgeo-org.1560.x6.nabble.com/GDAL-Dev-f3742093.html


More information about the gdal-dev mailing list