pub fn write_shapefile(
geojson: JsValue,
options: JsValue,
) -> Result<ShapefileParts, JsValue>Expand description
Builds a shapefile from a GeoJSON value passed straight across the wasm boundary.
A shapefile holds exactly one geometry type, so mixed input is rejected —
except Point and MultiPoint, which are promoted to a single Multipoint
file. Dimensionality follows the coordinates unless options.dimensions
overrides it, and the .dbf schema is inferred from every feature’s
properties.
§Arguments
geojson- AFeatureCollection, a loneFeature, a bare geometry, or an array of any of those.options- AnOptionsobject, ornull/undefinedfor the defaults.
§Errors
Returns a JavaScript Error when the input is not valid GeoJSON, mixes
incompatible geometry types, holds no writable features, contains a
malformed coordinate or a degenerate ring, or uses GeometryCollection.