Shapefile — Roads Index (.shx)
Unlike the point index, these entries have different lengths because each PolyLine holds a different number of vertices. That makes it the useful case for testing seek logic — a reader that assumes a fixed stride reads the first record correctly and then garbage.
| record | content length (words) | vertices |
|---|---|---|
| 1 | 56 | 4 |
| 2 | 48 | 3 |
| 3 | 48 | 3 |
Specifications
- Format
- Esri shapefile component
- Crs
- WGS 84 (EPSG:4326)
- Byte Order
- mixed — big-endian headers, little-endian records
- Sidecar Set
- .shp/.shx/.dbf/.prj/.cpg
- Records
- 3
- Entry Bytes
- 8
- Variable Record Lengths
- true
- Content
- offset and content length, both in 16-bit words, big-endian
Testing contract
Expected to pass- Scenario
- Seek to each record via the index and compare with a sequential scan of the .shp.
- Expected result
- All three offsets land on record boundaries even though the record lengths differ; a fixed-stride reader desynchronises after the first record.
What is a .shx file?
The .shx file is the positional index of an Esri shapefile. It repeats the .shp header and then stores one fixed 8-byte record per feature, giving the byte offset and content length of that feature in the .shp file, so a reader can seek directly to feature N instead of scanning from the start.
How to use this file
Use an example .shx file to test shapefile readers and repair tools, verifying that offsets resolve to real records in the .shp file and that a reader detects a mismatch between the index and the geometry rather than reading past the end.
How to use this file for testing
“Shapefile — Roads Index (.shx)” is a deterministic Novus Examples fixture for Geospatial, Serialization testing, Performance testing. GeoJSON, GPX, and KML files with points, lines, polygons, and tracks — for testing map tools, route parsers, and geo importers.
Documented properties for this file: 3 records · Esri shapefile component. Compare results against paired or grouped companions on this page when present (clean↔damaged, searchable↔scanned, or format twins) so scores stay reproducible across runs.
Download the file once, keep the path stable in CI or local scripts, and treat the spec table as the contract: dimensions, seeds, field lists, and roles are intentional. Corrupt or invalid samples are labelled as such — expect parsers to fail loudly rather than silently accept them.
Geospatial fixtures publish one invented territory across formats, with the coordinate reference system and feature counts documented in specs. Convert or reproject and diff against the twin in the same group; edge-case geometries state exactly which assumption they are built to break.
Related files
- shxShapefile — Parcels Index (.shx)The parcel index, whose second entry is markedly longer than the others because that record carries two rings. Use it together with the roads index to check that seek logic handles multi-part records as well as multi-record files.

- shxShapefile — Towns Index (.shx)The index that lets a reader seek directly to record N of the .shp instead of walking the file. Its header duplicates the .shp header exactly, and a mismatch between the two is the most common way a hand-edited shapefile goes wrong.

- dbfShapefile — Parcels Attributes (.dbf)The parcel attribute table, joined to the .shp purely by record order — there is no key and no explicit link. Deleting a geometry without deleting its row shifts every subsequent attribute onto the wrong shape, silently.

- shpShapefile — Parcels Geometry (.shp, Polygon with a hole)Three Polygon records, one of which has two rings: the Mill Court parcel and its courtyard. Shapefile winds rings the opposite way to GeoJSON — exterior clockwise, holes anticlockwise — and it has no explicit hole marker, so winding is the only signal a reader has.

- dbfShapefile — Towns Attributes (.dbf, dBase III)The attribute table as a dBase III file: fixed-width, space-padded, ASCII numerics. Field names are capped at ten characters and there is no type for dates-with-time or for nested values, which is why shapefile export loses so much of a modern schema.

- shpShapefile — Towns Geometry (.shp, 5 Point records)The geometry half of a point shapefile: a 100-byte header carrying the shape type and bounding box, then five 20-byte Point records. The file is useless on its own — attributes live in the .dbf and the coordinate system in the .prj, which is the point of shipping the whole component set.

Generated by generation/geospatial.py. Free for any use, no attribution required — license.