Shapefile
Parser for an ESRI shapefile (.shp). Reads the entire input eagerly into a List<ShapefileRecord> at construction time; iteration is then in-memory and allocation-free. Mirrors the behavior of WebWorldWind's Shapefile class.
Optional sidecar files can be supplied:
projection —
.prjcontent; only the geographic-vs-projected distinction is used, matching the reference. Projected shapefiles are not supported (see PrjFile).attributes —
.dbfcontent; rows are matched to records by their 1-based index.
Spec: ESRI Shapefile Technical Description (July 1998), pages 4–5 (file header / record headers), pages 5–13 (per-shape-type record contents).
Constructors
Properties
File bounding rectangle as [minY, maxY, minX, maxX] (latitude, longitude for geographic shapefiles).
File length in bytes (the on-disk header value is in 16-bit words; doubled here).
Eager list of records. Materialized on first access via recordsSequence and cached. Preferred for small/medium shapefiles; use recordsSequence directly for huge files where the full list would dwarf heap.
Lazy iteration over the records in this shapefile. Each call walks the bytes from the start; iterators are independent so callers can take, filter, etc. without affecting other consumers. NULL records are silently skipped. DBF attributes (if attributes was supplied at construction) are joined by record-number index.