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

TUELLER, SHAYNE R CIV USAF AFMC 519 SMXS/MXDEC shayne.tueller at us.af.mil
Tue Jan 22 09:34:36 PST 2019


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

-----Original Message-----
From: Even Rouault <even.rouault at spatialys.com>
Sent: Saturday, January 19, 2019 1:36 AM
To: gdal-dev at lists.osgeo.org
Cc: TUELLER, SHAYNE R CIV USAF AFMC 519 SMXS/MXDEC <shayne.tueller at us.af.mil>
Subject: [Non-DoD Source] Re: [gdal-dev] ogr not reading the prj file

On vendredi 18 janvier 2019 23:44:48 CET TUELLER, SHAYNE R CIV USAF AFMC 519 SMXS/MXDEC wrote:
> Hello,
>
> I'm using gdal 2.3.1 that I built from source. I run the following
> command to inspect the contents of a shapefile...
>
> ogrinfo -al circles.shp
>
> When I run this command on the shapefile, I get the SRS information
> "Layer SRS_WKT" reporting from what is found in the "data" folder and
> not the SRS information defined in the circles.prj file.

For shapefiles, GDAL will try to identify the SRS information from the .prj against one known SRS from the EPSG database. In case of a match, it will use the later definition, in particular to get the code of the SRS, which is practical in many uses.
Is it a case of wrong identification ?
If so, could you share the .prj file ?

Even

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


More information about the gdal-dev mailing list