How would you explain what a shapefile is to someone who is not already a GIS-professional but is interested in learning more?

Shapefiles are one of the most common GIS data storage formats. However shapefiles are as I have understood not really a single file but instead a set of files, containing as a minimum a

and a

  • .dbf-file storing the so called "attributes" (and being a database file format developed in the 80'es if I'm not mistaken).

and a

  • .shx-file being kind of an index putting all of these attributes together with the

Moreover each shapefile (set of files) only contains a single type of vector GIS data being either of the type Point, Polyline, Polygon and Multipoint and hence I suppose it is common to work with several shapefiles simultaneously when manipulating them in for example ArcGIS or QGIS.

I find all of this a bit confusing and therefore my question.

  • 2
    I would tell them to read this Wikipedia article: en.wikipedia.org/wiki/Shapefile. Then if they had any specific questions, I'd welcome them back here.
    – Berend
    Nov 28 '19 at 12:59

Actually, you've got the .shx component purpose wrong (though it's a common misconception).

The .shp component contains a header and the coordinate data. The .shx contains the same header and a simple array of {record number, starting position} records, for direct access by record number to the actual geometry records in the .shp. The .dbf is an 80's technology dBase-III+ file, tied to the geometry by record number. That's it. Nothing special, just a (somewhat archaic) data format.

The only important things to remember about shapefiles are:

  • It's a common binary datafile format for spatial data
  • It's a multi-file format, so always keep the pieces with common prefixes together
  • Each file set supports one geometry type (Point or Multipoint or Polyline or Polygon or PointZ or,... and on through PolygonZ, PolygonM, and PolygonZM)
  • Each file set supports only one set of attributes (so the use of different shapefiles for oceans, counties, parks, roads, rails, churches, schools, etc. is not only common, but doubling up on represented features is discouraged).
  • You don't need to understand the byte organization of the file layout to use it (only to write your own I/O module)
  • It was never intended to be the one common format for all of GIS for the past ~28 years, so cut it some slack
  • It has so many limitations that it really isn't used as much by GIS professionals any more

Other related questions:

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.