What belongs in a Shapefile bundle?
- .shpGeometry records and XY/Z/M coordinates
- .shxFixed-size offsets into SHP records
- .dbfOne ordered attribute row per feature
- .prjCoordinate-reference text, usually WKT
- .cpgDBF character-encoding declaration
The first three are the core interoperable set. PRJ and CPG prevent coordinate-system and text-decoding guesses. Every sidecar should travel with the same basename and case.
Checks performed
The auditor checks the mixed-endian 100-byte SHP/SHX headers, declared file sizes, shape types, sequential record numbers, bounded geometry arrays, XY bounds, SHX offsets and lengths, and the one-to-one SHP/DBF record relationship. It also inspects DBF field descriptors, row widths, deletion markers, language-driver metadata, CPG declarations, lightweight PRJ/WKT metadata, duplicate files, unsafe paths, and basename case drift.
Safe derived repair
An SHX file contains offsets and lengths that can be deterministically recomputed from a completely scanned SHP. The download creates a separate SHX and leaves every selected file untouched. Review the new sidecar in a copy of the dataset before replacing production data. The auditor does not rewrite malformed geometry, reorder DBF records, guess an encoding, invent a CRS, or silently rename files.
Important audit boundary
This is a bounded structural and interoperability diagnostic, not a topology engine, GIS renderer, full dBASE implementation, or CRS authority. It does not prove polygons are topologically valid, resolve every legacy code page, calculate spatial-index correctness, validate all optional sidecars, transform coordinates, or guarantee identical behavior across GIS applications. Open repaired copies in the target GIS and retain the original bundle.
Frequently asked questions
Why must DBF and SHP counts match?
Shapefile attributes are joined to geometry by record position. A count mismatch means features and rows cannot maintain the required one-to-one correspondence.
Does this display my map?
No. It scans structure, counts, coordinate bounds, and cross-file relationships. Avoiding a map renderer keeps the tool focused on bundle failures that often survive a visual spot check.
Is a missing CPG always corruption?
No. Older DBF files may carry a language-driver ID, but that metadata can be ambiguous. The auditor reports the evidence without guessing that the visible text is correct.
Authoritative references
The Esri Shapefile Technical Description defines the SHP header and records, SHX offsets, supported shape types, and one-row-per-feature DBF relationship. The GDAL Shapefile driver documentation documents current handling of PRJ, CPG and DBF language-driver encoding metadata, optional indexes, and SHX restoration.
Audit a raster world file · Preflight an image · Browse GIS tools