The ESRI Shapefile is one of the most widely used geospatial vector data formats for Geographic Information Systems (GIS). Developed by Esri in the early 1990s, shapefiles store the geometric location and attribute information of geographic features such as points, lines, and polygons.
Despite its name, a "shapefile" is actually a collection of multiple files that work together to describe vector features. This format has become an industry standard due to its simplicity, widespread software support, and ability to handle large datasets efficiently.
Upload a .zip file or individual shapefile components (.shp, .shx, .dbf, .prj)
A shapefile is actually a collection of files that work together. The three mandatory files are:
The .shp file contains the geometry data in binary format. It stores the actual shape coordinates (points, lines, or polygons) using a specific binary structure defined by Esri.
File Header (100 bytes): - File code (9994) - File length - Version (1000) - Shape type (Point=1, Polyline=3, Polygon=5, etc.) - Bounding box (minX, minY, maxX, maxY) Records: - Record header (record number, content length) - Shape type - Geometry data (coordinates)
The .shx file is a positional index that stores the byte offset of each record in the .shp file. This allows software to quickly jump to specific features without reading the entire file sequentially.
The .dbf file stores attribute data in dBASE IV format. Each row corresponds to a feature in the .shp file, and columns contain attribute fields like names, IDs, categories, and measurements.
Header (32 bytes): - Version number - Last update date - Number of records - Header length - Record length Field Descriptors (32 bytes each): - Field name (11 bytes) - Field type (C=Character, N=Numeric, D=Date, L=Logical) - Field length - Decimal count Records: - Deletion flag - Field values
The .prj file contains the coordinate reference system (CRS) definition in Well-Known Text (WKT) format. Without this file, the coordinates are ambiguous and cannot be properly interpreted.
Shapefiles support various geometry types, each representing different spatial features:
Type 1: Point Single coordinate (X, Y) Type 3: Polyline Connected line segments Type 5: Polygon Closed area with boundary Type 8: MultiPoint Multiple disconnected points Type 11: PointZ Point with Z (elevation) Type 13: PolylineZ Polyline with Z values Type 15: PolygonZ Polygon with Z values Type 21: PointM Point with M (measurement) Type 23: PolylineM Polyline with M values Type 25: PolygonM Polygon with M values Type 31: MultiPatch 3D surface (TIN, mesh)
Shapefiles are used across numerous industries and applications:
While shapefiles remain popular, modern alternatives address many limitations: