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

Even Rouault even.rouault at spatialys.com
Tue Jan 22 09:32:12 PST 2019


On mardi 22 janvier 2019 16:56:56 CET TUELLER, SHAYNE R CIV USAF AFMC 519 
SMXS/MXDEC wrote:
> 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]]

ok, so I guess ogrinfo -al -so reports

GEOGCS["WGS 84",
    DATUM["WGS_1984",
        SPHEROID["WGS 84",6378137,298.257223563,
            AUTHORITY["EPSG","7030"]],
        AUTHORITY["EPSG","6326"]],
    PRIMEM["Greenwich",0,
        AUTHORITY["EPSG","8901"]],
    UNIT["degree",0.0174532925199433,
        AUTHORITY["EPSG","9122"]],
    AUTHORITY["EPSG","4326"]]

This is the expected behaviour. The content of a .prj file is WKT with the 
ESRI variant formatting. Newer GDAL versions manage to retrieve the OGC WKT 
definition when the ESRI WKT corresponds to a EPSG code.

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


More information about the gdal-dev mailing list