Skip to main content

read_shapefile_to_json

Function read_shapefile_to_json 

Source
pub fn read_shapefile_to_json(
    shp: &[u8],
    dbf: Option<Vec<u8>>,
    options: JsValue,
) -> Result<String, JsValue>
Expand description

Reads a shapefile and returns GeoJSON as a string.

Identical to read_shapefile but skips building JavaScript objects, which is cheaper when the result is headed straight for a file or the network rather than for code that will walk it.

§Arguments

  • shp - Contents of the .shp.
  • dbf - Contents of the .dbf, optional.
  • options - A read::ReadOptions object, or null/undefined.

§Errors

Returns a JavaScript Error for the same reasons as read_shapefile, or if the result cannot be serialised.