georust / geozero

Zero-Copy reading and writing of geospatial data.
Apache License 2.0
322 stars 30 forks source link

Add GDAL read support for more types #165

Closed Oreilles closed 10 months ago

Oreilles commented 10 months ago

This PR adds GDAL read support for CircularString, CompoundCurve, CurvePolygon, Triangle, MultiCurve, PolyhedralSurface, TIN, MultiSurface. The implementation is mapped from the Wkb reader. Tests are added using Wkb since the Wkt crate doesn't support those types.

I initially wanted to also add write support, but didn't manage to do so with the current writer implementation.. Considering that the GDAL writer currently doesn't handle 3D geometries and GeometryCollection (according to the commented out tests), a bigger refactor might be the opportunity to adress those issues and add support for these new types as well?

This PR also includes a refactor of fn type2d to use gdal_sys::OGR_GT_Flatten(wkb_type) to get the 2D geometry type. Is it safe to do so ?

pka commented 10 months ago

Thanks!