[gdal-dev] orginfo and prj files

Mateusz Loskot mateusz at loskot.net
Thu Aug 14 11:09:58 EDT 2008


Lucena, Ivan wrote:
> Hi there,
> 
> Correct if I am wrong.
> 
> If there is a .PRJ file associated with a .SHP, ogrinfo will just print 
> out the content of the .PRJ. Ex.:

Ivan,

It does
1) import it expecting it might be in ESRI WKT format
2) print it

> """
> D:\Data\ESRIDATA\USA> ogrinfo -so states.shp states
> INFO: Open of `states.shp'
>       using driver `ESRI Shapefile' successful.
> Layer name: states
> Geometry: Polygon
> Feature Count: 51
> Extent: (-178.217598, 18.924782) - (-66.969271, 71.406235)
> Layer SRS WKT:
> GEOGCS["GCS_North_American_1983",
>     DATUM["North_American_Datum_1983",
>         SPHEROID["GRS_1980",6378137,298.257222101]],
>     PRIMEM["Greenwich",0],
>     UNIT["Degree",0.0174532925199433]]
> """
> 
> It will not going to run "OGRImportFromESRI()" to get EPSG Authority 
> codes. Isn't it right?

For Shapefile format specifically, it does run through morphing 
procedure by calling OGRSpatialReference::importFromESRI

The doc may be imprecise perhaps, but IMO it suggests that:

"If a .prj files in old Arc/Info style or new ESRI OGC WKT style is 
present, it will be read and used to associate a projection with features."

http://gdal.org/ogr/drv_shapefile.html

Best regards,
-- 
Mateusz Loskot, http://mateusz.loskot.net
Charter Member of OSGeo, http://osgeo.org


More information about the gdal-dev mailing list