#shapefile #geo-json #geospatial #data #wkt #spatial-index

geozero-shp

WARNING: The shp driver is now included in geozero

7 releases (4 breaking)

0.5.1 Sep 26, 2024
0.5.0 Aug 28, 2024
0.4.0 Jan 27, 2023
0.3.1 Apr 1, 2022
0.1.0 Jan 5, 2021

#2 in #shapefile

MIT/Apache

640KB
12K SLoC

DEPRECATED: The shp driver is now included in geozero.

GeoZero Shapefile driver

Reading Shapefiles with GeoZero API.

Features:

  • Read support for OGC simple feature types
  • Convert to GeoJSON, WKB (PostGIS/GeoPackage), WKT, GEOS, GDAL formats and more
  • Support for Multipatch types
  • Read spatial index
  • Read projection files

For writing Shapefiles either use shapefile-rs or the GDAL driver of GeoZero

Originally based on shapefile-rs from Thomas Montaigu.

Usage example

use geozero::geojson::GeoJsonWriter;

let reader = geozero_shp::Reader::from_path("poly.shp")?;
let mut json: Vec<u8> = Vec::new();
let cnt = reader.iter_features(GeoJsonWriter::new(&mut json))?.count();

Dependencies

~1.7–2.7MB
~56K SLoC