5

I notice that sometimes Shapefiles that I have received contain .prj files. Sometimes they don't. Wikipedia notes that the .prj file is not "mandatory" and that it contains the :

projection format; the coordinate system and projection information, a plain text file describing the projection using well-known text format

So my question is: why is it sometimes included, and sometimes not? Do newer versions of Esri tools include it, whereas older ones didn't?

Steve Bennett
  • 5,682
  • 2
  • 44
  • 69
  • This "Why" question is really directed at the individuals who don't choose to adequately define their data. It has nothing to do with Esri tools. – Vince Nov 05 '17 at 13:45
  • So whether a prj file is included is a conscious decision made by the creator of the dataset? – Steve Bennett Nov 06 '17 at 04:18
  • Well, *not* including it certainly is. – Vince Nov 06 '17 at 04:24
  • In my experience, inexperienced users/users from a different discipline are generally when I receive a shapefile lacking a *.prj. Often, I ask for the .prj and .dbf, .shx files explicitly, or that I expect ~7 files in a "shapefile". – bwp8nt Nov 06 '17 at 05:13

2 Answers2

10

The original and only published version of the shapefile format defines only three mandatory files:

An ESRI shapefile consists of a main file, an index file, and a dBASE table.

Shapefiles were introduced with ArcVIEW 2.0 and it may be that it could not utilize .prj files. The .prj file itself was already used by ESRI in the Arc/Info E00 coverage format.

Possible reasons to not use a .prj file

  • It is not compulsory
  • The strings to use in .prj are not documented by ESRI, so other vendors have had to reverse engineer them.
  • .prj is not needed if a user works in a single coordinate system all the time
  • Data providers can usually communicate by other means what the correct coordinate system is

In .prj files, ESRI is using Well Known Text strings that are similar, but not identical to the WKT format defined by the Open Geospatial Consortium. As an example, here is the GDAL source code that tries to make those two definitions to match.

Dreamer
  • 223
  • 2
  • 6
user30184
  • 65,331
  • 4
  • 65
  • 118
  • There's some advice on what's in a *.prj on this site at https://gis.stackexchange.com/a/114854/115 – PolyGeo Nov 05 '17 at 11:02
1

Shapefiles contain geographical objects (e.g. points, lines, polygons on the globe). The coordinates of these objects in the shapefile are merely abstract numbers without any inherent meaning.

A .prj file specifies the meaning of these coordinate numbers. Without a .prj file you'd have to guess what those numbers mean (which actually usually works fine, because most of the time they are latitude/longitude pairs in the WGS-84 datum).

So, one would include a .prj file either for completeness or if the coordinate system used in the shapefile is not obvious. On the other hand, one might omit a .prj file if the recipient can't process them or expects the shapefiles to use a single given coordinate system anyway.

Dreamer
  • 223
  • 2
  • 6
  • 1
    I wouldn't say that shapefile are in the WGS-84 datum most of the time but it's true that if you work in a specific area in a specific field you tend to mostly get data on a few recognizable CRS – J.R Oct 02 '23 at 08:57