-
Notifications
You must be signed in to change notification settings - Fork 24
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
[common] Update to georust/geo v0.29.0 #328
Conversation
A lot of the line measure traits were re-worked. Mostly this is just moving code around in hopes of similar methods across metric spaces being easier to find now that they are uniform. It also enabled replacing some mostly copy/pasted implementations in geo with generic implementations, which enabled some new functionality - e.g. we can now `.densify::<Geodesic>` One notable behavioral change: the output of the new `Bearing` trait is now uniformly 0...360. Previously GeodesicBearing and HaversineBearing returned -180..180 while RhumbBearing returned 0...360. georust/geo#1210 This actually uncovered a bug in ferrostar, reflected in the new output of ferrostar/src/snapshots/ferrostar__simulation__tests__state_from_polyline.snap Since previously we were casting a potentially negative number to u16 — now it's always positive (0...360).
// Compute total segment length in meters | ||
let segment_length = segment_linestring.haversine_length(); | ||
let segment_length = segment_linestring.length::<Haversine>(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For example, you could double down on the more accurate but slower segment_linestring.length::<Geodesic>()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, exactly. That's probably worth evaluating properly. I've opened #329 to follow up on this. This is probably a case where Geodesics could make sense. On the other hand, I am pretty sure Valhalla uses haversine exclusively and is generally fine 😂
A lot of the line measure traits were re-worked: https://docs.rs/geo/latest/geo/#measures
Mostly this is just moving code around, consolidating in hopes of similar methods across metric spaces being easier to find now that they are uniform.
It also enabled replacing some mostly copy/pasted implementations in geo with generic implementations, which enabled some new functionality - e.g. we can now
.densify::<Geodesic>
One notable behavioral change: the output of the new
Bearing
trait is now uniformly 0...360. Previously GeodesicBearing and HaversineBearing returned -180..180 while RhumbBearing returned 0...360. (see georust/geo#1210 for more)This actually uncovered a bug in ferrostar, reflected in the new output of
ferrostar/src/snapshots/ferrostar__simulation__tests__state_from_polyline.snap
Since previously we were casting a potentially negative number to u16 — now it's always positive (0...360).
There are some other changes I'd like to make, but this represents a mostly drop in replacement for the current behavior.