[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 08:56:56 PST 2019


Thank you for the reply.

I don't think it's a case of wrong identification because the prj file gets read in just fine with ogrinfo in gdal 1.11. When I use the gdal 2.3.1 I built from source on Windows, it no longer reads the associated prj file that is used with the shapefile. Instead, it grabs whatever is defined in the "data" folder. I think it may have something to do with the way I built the library but I'm not sure.

Here is the contents of the circles.prj associated with the circles.shp file...

GEOGCS["GCS_WGS_1984", DATUM["D_WGS_1984", SPHERIOD["WGS_1984", 6378137, 298.257223563]],PRIMEM["Greenwich",0],UNIT["Degree",0.017453292519943295]]

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