georust / proj

Rust bindings for the latest stable release of PROJ
https://docs.rs/proj
Apache License 2.0
137 stars 44 forks source link

Discussion: Move Transform trait from geo to proj? #108

Closed michaelkirk closed 2 years ago

michaelkirk commented 2 years ago

This might be controversial, but https://github.com/georust/proj/pull/106 got me thinking: If people want to interop proj with geo-types, it's likely that they want something like the Transform trait we just added to geo.

In other words, if they are using proj --features geo-types it seems inevitable that they are going to end up writing some subset of the Transform trait themselves.

What if we instead:

  1. moved the Transform trait to proj
  2. added impl Transform for geo-types::* to proj (behind the geo-types feature)
  3. have geo leverage the impl in proj, so as not to lose that functionality.

One downside is that the current Transform impl, being in geo, leverages the MapCoords feature, so the impls in proj would be more verbose, which isn't ideal, but if we're going to add the ability to transform geo-types to proj (like #106 proposes), it seems like we might as well consolidate around one implementation.

michaelkirk commented 2 years ago

I'm experimenting with this now - using a trait based approach more like that in https://github.com/georust/geo/pull/718

frewsxcv commented 2 years ago

https://github.com/georust/geo/pull/730