georust / geozero

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

How to convert from geo_types::Geometry to geozero::GeozeroGeometry #13

Closed tumluliu closed 2 years ago

tumluliu commented 2 years ago

Hi there, I'm trying to find out the most appropriate way to write some geo::MultiLineString typed objects into a flatgeobuf format file. Now I'm facing the issue when calling FgbWriter::add_feature_geom because I don't know how to create the required GeozeroGeometry type parameter. Could you please give me some hints or are there any examples for such use case?

I have seen from the FgbWriter's tests that it's using the raw flatbuffers to write the points. Is that the recommended way?

And the impl GeozeroGeometry for geo_types::Geometry<f64> looks already pretty close to the answer. But I still could not (yet) figure out how to use it properly. Sorry for my very limited rust knowledge. And thank you in advance!

tumluliu commented 2 years ago

I think I have found a good reference from this test fn . Thanks for making such a nice lib!