georust / proj

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

Add ability to convert 3d coordinates #176

Open PaulWagener opened 11 months ago

PaulWagener commented 11 months ago

Fixes #150

This PR adds the ability to convert 3d coordinates.

The Coord trait is changed to add a Z coordinate so at least a minor version bump is warranted with this change.

urschrei commented 11 months ago

Hi @PaulWagener, thanks for the PR!

As ever with 2D -> 3D, there's likely to be some discussion…

At minimum, I don't think we can remove the xy functions in one fell swoop as that would break a great deal of downstream code. I think marking them as deprecated in favour of the new ones is better, here.

As for Coord, we're looking at the same problem. In a sense, this is our fault for using an overly general name, but changing the signature will break a lot of code. How do people feel about a new Coord3 (or maybe Coord4 to include M values) struct and deprecating Coord.

Even more radically: we could adopt Rust-Geodesy's coordinate struct…

PaulWagener commented 11 months ago

As long as 3D coordinates will be supported I will be happy :)