Skip to main content

write_shapefile_from_json

Function write_shapefile_from_json 

Source
pub fn write_shapefile_from_json(
    geojson: &str,
    options: JsValue,
) -> Result<ShapefileParts, JsValue>
Expand description

Builds a shapefile from a GeoJSON string.

Identical to write_shapefile but for the input: the text is parsed in Rust, avoiding a JSON.parse in JavaScript when the data arrived as text in the first place.

§Arguments

  • geojson - Serialised GeoJSON.
  • options - An Options object, or null/undefined for the defaults.

§Errors

Returns a JavaScript Error when the string is not valid JSON, or for any reason write_shapefile would fail.