-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Interaction with Geo types #5
Comments
This would include |
I did a few experiments and I would simply go for the pure float interface to avoid having to create extra temporary elements on the stack (which would be the case as well for using |
@bluenote10 Very interesting! Thanks for spending time on this. Did you push your branch anywhere? Would be curious to see what changes you made |
Another option is to add a pub trait Coord {
fn x(&self) -> f64;
fn y(&self) -> f64;
}
pub fn orient2d<T: Coord>(coord_a: T, coord_b: T, coord_c: T) -> f64 {
...
} And then users of |
my current feeling is that the georust ecosystem should make use of the |
#9 has merged, so |
This is true for any integration using geo-types (or the mint type if we go that way), but doesn't help people outside of geo-types.
This is the route I went with in proj, and AFAIK it went ok: georust/proj#41 I'd advocate for that route since it avoids a runtime conversion for geo-types and equally allows other folks to conform their type if they aren't using geo-types. |
From @bluenote10's comment:
Several possibilities here:
geo_types::Coordinate
(I assume @frewsxcv didn't use it for a reason, but it may simply have been in order to get everything working)From
impls forGeo
types (and primitive types such as(T, T)
and[T; 2]
) torobust::Coord
, and modify the functions to acceptInto<Coord>
instead, with an explicitinto()
call inside the functions.Either way, we'll probably want to land #3 first.
The text was updated successfully, but these errors were encountered: