Closed JorgeMartinezG closed 3 years ago
Thanks for the bug report! This is likely because of mismatched versions between dependencies. Can you cargo-tree
to ensure all your geo-types
and geojson
dependency versions match?
@frewsxcv Thank you! Running cargo tree
saw a mismatch between geojson (0.20.1) and the geojson crate used in geos (0.19.0). changing the version in Cargo.toml file worked perfectly
Glad that worked! I created a new issue for tracking the version mismatch: https://github.com/georust/geos/issues/82
For new users coming into this issue, please check https://github.com/rust-lang/rust/issues/22750
First of all, thanks for this library.
I am experimenting an issue converting from geos::Geometry to geojson::Geometry type. It looks like the readme has not been updated since this commit https://github.com/georust/geos/commit/1614a49deedc01b2f0cd4de24852105ba9cabe2f makes use of the std TryFrom trait.
I have this sample code:
and the compiler shows this error:
I have the geos library with json feature enabled.
Curiously, the code compiles by first doing a conversion to geo_types and then to geojson
I found here https://github.com/georust/geos/blob/0a4862d722b593e7dbb60311e8a58e0e724ae13a/src/enums.rs#L5 that the crate has its own TryFrom trait, but I am not sure if it is related.
It looks like the geojson::Geometry type has not implemented the TryFrom crate within to_geojson.rs file.
Let me know your opinion