Open tmontaigu opened 3 years ago
I've used geozero just a bit, but haven't used the shapefile features. If you haven't already found it, there is some support for reading (but not yet writing) shapefiles https://github.com/georust/geozero/blob/master/geozero-shp/src/shp_reader.rs
The reading support leverages your dbase crate.
If you have questions, the primary author @pka might be able to help.
Converting between formats without intermediate representation is the primary goal of geozero. The mentioned driver is a stripped down version of shapefile-rs which supports reading shapefiles and converting to geo_types, but also to GeoJSON, WKT, GEOS, GDAL and others. But the other direction is not supported and not high on the priority list. If there is a idea for collaboration, I'm open for it.
I wanted to explore the possibility of reading and writing directly to geo_types without going through conversions between shapefile-rs types and geo_types as I think geo_types are often used.
Implementing that using geozero, if I understand correctly, would give more flexibility in the output type of the reader however I also need the ability to write and I'd like this to be an optional feature
I'm interested in following the discussion here as well as I've started trying to use this library to add shp reading to https://github.com/worace/geoq.
1 thing that I've run into a lot when working in the geo rust ecosystem is that geo_types
coordinates only support x and y. With that limitation, I think you are always going to need some additional set of types to handle the Z and M variants, right?
I was looking at similarly reading shp -> geojson, and while I could potentially rely on the shapefile -> geo_types conversions shipped with this library to go shp -> geo_types -> geojson
, it would only work for the 2d variants. So I think I may end up doing the whole shp -> geojson
matching myself for the sake of handling as many geom types as possible.
geozero is new to me as well; I will need to spend some time reading up on that. But from a quick scan it looks like it does support the dimensions needed at least. Maybe that would be a better fit for the kind of things I'm doing as well.
This might not be possible as some geotypes are not compatible / has no shapefile equivalent, but should still be looked into