Friday, 20 September 2019

shapefile - Is there a standard for the specification of .prj files?


We use shape files for data exchange. I've looked at the .prj files: different programs produce different prj files.


Is there a standard how the parameters must be specified in a prj file?


AFAIK the name of the projection (e.g. PROJCS["ETRS89 / UTM zone 32N (zE-N)",…]) can be freely assigned. But I can not believe that the name of the datum (e.g. DATUM["D_ETRS_1989",…]) can be assigned freely too.


I have found no information about this. Even in ESRI Shapefile Technical Description there is no information about .prj files. The ESRI KB Article 14056 HowTo: Create projection metadata (.prj) files for shapefiles says: “You have to use the predefined names for map projection and parameter objects”. But the article does not specify where to find these predefine names. Does each GIS-company specify it own names? Or does EPSG specify these names?


Here are a few differences in a section of .prj files (EPSG 4647) between QGIS, AutoCAD Map and spatialreference.org


enter image description here



Answer



There's some information on the OGC Call for Comments page on the new specification for coordinate reference system WKT standard.


The original specification was written by Esri many moons ago for OGC based on the mid-1990s version of the EPSG Geodetic Parameter Dataset's schema. It was revised and extended by other OGC specifications. Because it was a very loosely defined specification, there arose many, sometimes subtly, different implementations. Over the past two years or so, a new specification has been hammered out. It's currently at ISO for comment.



Although I have some documentation on 'best practices' for writing an Esri-flavor prj string, it's not been published in the documentation.


The EPSG registry can now export WKT for its objects based on this new specification. Here's WGS 84, geographic 2D CRS, as a sample:


GEODCRS["WGS 84",
DATUM["World Geodetic System 1984",
ELLIPSOID["WGS 84",6378137,298.257223563,LENGTHUNIT["metre",1.0]]],
CS[ellipsoidal,2],
AXIS["latitude",north,ORDER[1]],
AXIS["longitude",east,ORDER[2]],
ANGLEUNIT["degree",0.01745329252],
ID["EPSG",4326]]


Existing WKT should be able to be read by a 'new' parser, but the converse won't be true. Some changes to note:



  • Top-level keywords have changed to enable parsers to quickly identify the new format

  • More elements of the schema are supported (like axis directions and ordering)



Update 6 July 2016: The CRS WKT specification/standard has been approved by ISO and OGC in 2015. The OGC version is here.



Disclosure: I work for Esri and helped write that first OGC specification, was a member of the group that hammered out the new specification, and is a member of the subcommittee that maintains the EPSG registry.



No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...