Skip to main content

Module read

Module read 

Source
Expand description

Reads shapefile components back into GeoJSON.

Two things make this more than a mechanical transcription:

  • A shapefile polygon is a flat bag of rings with no nesting, so the holes have to be matched back to the ring that contains them before GeoJSON can describe them.
  • A .dbf carries no encoding of its own. The caller passes whatever the companion .cpg said, and we fall back to UTF-8.

Structs§

ReadOptions
Caller-tunable knobs for reading. #[serde(default)] fills absent fields from Default, so the derived impl and the deserialised defaults are the same thing by construction.

Functions§

read
Reads a .shp (and optionally its .dbf) into a GeoJSON FeatureCollection.