Expand description
Reads and writes ESRI Shapefiles from GeoJSON, entirely in memory.
The public surface is deliberately small: hand it GeoJSON, get back the raw
.shp / .shx / .dbf byte buffers — or hand it those bytes and get GeoJSON
back. Zipping, projection files and anything browser-shaped is left to the
TypeScript layer, which keeps the wasm binary small and this core usable from
plain Rust too.
§Entry points
write_shapefile/write_shapefile_from_json— GeoJSON to bytesread_shapefile/read_shapefile_to_json— bytes to GeoJSONset_panic_hook— route panics toconsole.errorwhile debugging
Modules§
- error
- geometry
- Turns parsed GeoJSON geometries into concrete shapefile shapes.
- input
- Parsing of the GeoJSON that comes in from JavaScript.
- read
- Reads shapefile components back into GeoJSON.
- schema
- Derives a dBase table schema from GeoJSON properties.
Structs§
- Field
Report - What one column became in the .dbf, so callers can report renames.
- Options
- Caller-tunable knobs. Every field is optional; the defaults suit most data.
- Shapefile
Parts - The generated shapefile components, plus what was inferred along the way.
Functions§
- read_
shapefile - Reads a shapefile back into a GeoJSON
FeatureCollection. - read_
shapefile_ to_ json - Reads a shapefile and returns GeoJSON as a string.
- set_
panic_ hook - Routes Rust panics to
console.errorwith a readable message and stack. - write_
shapefile - Builds a shapefile from a GeoJSON value passed straight across the wasm boundary.
- write_
shapefile_ from_ json - Builds a shapefile from a GeoJSON string.