ArcGIS shapefiles have mandatory and optional files. The mandatory file extensions needed for a shapefile are .shp, .shx and .dbf. But the optional files are: .prj, .xml, .sbn and .sbx
What is the function of each of these ArcGIS file types? Also, how do you open these GIS files?
If you have several hours to spare, you could go through the 34-page ESRI Shapefile Technical Description document. If time is a factor, then we suggest reading further. Let’s take a closer inspection of what makes up an ArcGIS shapefile.
What are the shapefile files?
Main File (.SHP)
SHP is a mandatory Esri file that gives features their geometry. Every shapefile has its own .shp file that represents spatial vector data. For example, it could be points, lines, and polygons in a map.
Index File (.SHX)
SHX are mandatory Esri and AutoCAD shape index positions. This type of file is used to search forward and backward.
dBASE File (.DBF)
DBF is a standard database file used to store attribute data and object IDs. A .dbf file is mandatory for shape files. You can open DBF files in Microsoft Access or Excel.
Projection File (.PRJ)
PRJ is an optional file that contains the metadata associated with the shapefiles coordinate and projection system. If this file does not exist, you will get the error “unknown coordinate system”. If you want to fix this error, you have to use the “define projection” tool which generates .prj files.
Extensible Markup Language File (.XML)
XML file types contain the metadata associated with the shapefile. If you delete this file, you essentially delete your metadata. You can open and edit this optional file type (.xml) in any text editor.
Spatial Index File (.SBN)
SBN files are optional spatial index files that optimize spatial queries. This file type is saved together with a .sbx file. These two files make up a shape index to speed up spatial queries.
Spatial Index File (.SBX)
SBX files are similar to .sbn files which speed up loading times. It works with .sbn files to optimize spatial queries. We tested .sbn and .sbx extensions and found that there were faster load times when these files existed. It was 6 seconds faster (27.3 sec versus 33.3 sec) compared with/without .sbn and .sbx files.
Code Page File (.CPG)
CPG files are optional plain text files that describe the encoding applied to create the shapefile. If your shapefile doesn’t have a .cpg file, then it has the system default encoding.
Mandatory and optional files for shapefiles
If you need to move shapefile files in Windows Explorer, you should drag and drop all the mandatory and optional files. If you are in ArcCatalog, it will move all the mandatory and optional files for you.
There are over 150 different GIS file extensions that exist that are exclusively for GIS. But this doesn’t even include AutoCAD and common image formats. For more information, see our list of GIS formats.
The most common GIS file type is shapefiles. Even the USGS Earth Explorer accepts shapefiles as input to define boundaries.
Shapefiles are composed of 3 mandatory files .shp, .shx and .dbf. But the optional files that make up a shapefile are: .xml, .prj, .sbn, and .sbx. If you can recognize these differences, then you can become a master of the ArcGIS shapefile.