Package-level declarations
Types
Character encodings supported by the dBASE / DBF string decoder. Single-byte codepages are decoded in pure Kotlin via 256-entry lookup tables, so no platform-specific Charset support is required. Multi-byte codepages (GBK, Shift_JIS, etc.) are not supported here — callers using those encodings should resolve them on their own.
Schema for a single DBF column.
Per-part type codes for MultiPatch records. Each part in a ShapefileShapeType.MULTI_PATCH record carries one of these to indicate how the vertices in that part assemble into triangles. The numeric values match the ESRI Shapefile Technical Description.
Projection (.prj) parser. Distinguishes geographic and projected coordinate systems via OGC well-known text. For projected systems we recognize the UTM family — the only projection commonly distributed with raw shapefiles — and expose a Projection that can convert easting/northing pairs into lon/lat. Other projected systems are flagged as projected-but-unsupported; callers can treat coordinates as geographic at their own risk.
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.
BulkFeatureSource for ESRI Shapefiles. Downloads the .shp/.dbf/.prj/.cpg quartet from shpUrl (sidecars derived by extension), parses every record through ShapefileLayerFactory, and emits one CachedFeatureRow per record with the geometry extracted as a CachedGeometry and the DBF attributes encoded as a JSON object string.
Builds a RenderableLayer from an ESRI shapefile. Two entry points:
One parsed shapefile record. Records of all shape types are represented by this single class; the shapeType field discriminates. Geometry is exposed as a list of "parts", each part an interleaved [x0, y0, x1, y1, …] DoubleArray matching the on-disk coordinate order (longitude, latitude for geographic shapefiles).
Per-record customization returned by the ShapefileLayerFactory shapeConfiguration callback. Match WebWorldWind's plain-object configuration: setting attributes / placemarkAttributes overrides the defaults; setting altitude or height switches polylines from SurfacePolyline to Path and polygons from SurfacePolygon to extruded Polygon; returning null from the callback skips the record entirely.
Shape type discriminator for a shapefile record. ESRI shapefiles carry the type code in the file header and again at the start of every record's contents.
Functions
Loads a shapefile distributed as a ZIP archive (the canonical packaging on most data portals). The first .shp, .dbf, .prj, and .cpg entries found are routed through ShapefileLayerFactory.createLayer. Entries deeper in subdirectories are accepted too, but only the first match of each extension is used — ZIP archives occasionally bundle multiple shapefiles together, and picking one deterministically is better than guessing.