Skip to main content

Module input

Module input 

Source
Expand description

Parsing of the GeoJSON that comes in from JavaScript.

We deliberately walk serde_json::Value by hand instead of pulling in the geojson crate: it keeps the wasm binary small and lets us accept the slightly-off shapes that real-world data tends to have (a bare geometry, a bare feature, a plain array of features).

Structs§

Feature
One row of the eventual shapefile: a geometry plus its attribute bag.
Position
A single coordinate, normalised to four ordinates so downstream code never has to worry about how many were actually present.

Enums§

Family
The four shapefile geometry families we can emit.
Geometry
A GeoJSON geometry, reduced to the six types a shapefile can represent.

Functions§

normalize
Accepts a FeatureCollection, a lone Feature, a lone geometry, or an array of any of those, and flattens it to a feature list.