Overview
The older OSM shapefile examples in the sibling workspace are a useful reminder that themed shapefiles remain common as an interchange format. The web map, however, usually wants something else:
- normalized fields
- simpler geometry
- consistent layer naming
- a format that performs well in the browser
Why it matters
- Raw shapefiles carry desktop-era constraints into web workflows.
- Browser maps do not need every field and every vertex.
- Publishing without schema cleanup leads to brittle layer logic.
When to use
Use this pattern when:
- receiving shapefile deliveries from consultants or public sources
- preparing web maps from desktop GIS archives
- publishing recurring layers into a static or low-complexity site
Inputs
- shapefile components or zipped shapefiles
- target layer list
- desired field schema
- simplification thresholds by layer family
- output target such as GeoJSON, PMTiles, or vector tiles
Workflow and method
UnpackConfirm.shp,.dbf,.shx, and projection metadata are present.InspectReview CRS, geometry type, field names, and record counts.NormalizeRename fields, drop dead weight, and standardize types.SimplifyReduce geometry complexity where cartographically safe.SplitSeparate layers by use or zoom strategy.PackageExport web-ready GeoJSON or vector tiles.
Recommended logic
| Layer type | Suggested action |
|---|---|
| Administrative boundaries | Keep attributes lean, preserve topology |
| Roads and lines | Simplify carefully, keep class hierarchy |
| Large polygons | Simplify by zoom target and preserve IDs |
| Dense points | Cluster or thin for small-scale views |
Suggested CLI layout
scripts/
publishing/
inspect_shapefile.js
normalize_schema.js
simplify_geometry.js
build_tiles.js
data/
incoming/
staged/
web/
QA checks
- Verify CRS before conversion.
- Compare bounding boxes before and after simplification.
- Confirm IDs survive into the publish layer.
- Inspect the output at multiple zoom levels in a browser map.
Outputs
Typical outputs:
- normalized GeoJSON
- vector tile package or equivalent publish artifact
- lightweight metadata note describing schema and simplification choices
Limitations
Some shapefiles are structurally messy enough that a quick pipeline will not save them. Broken geometries, weak CRS metadata, and overloaded attribute tables often require a dedicated cleaning pass before web packaging is safe.