-
Notifications
You must be signed in to change notification settings - Fork 196
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
Replace HaversineIntermediate with HaversineLineInterpolatePoint and HaversineDensify #1181
Comments
Oh man, the plot thickens. Maybe we shouldn't just get rid of I don't have a solution yet and have run out of time to think about this today, but I'm open to proposals about how to re-align things to increase uniformity and decrease redundancy. |
One option would be to have an fn intermediate_haversine(start: &Point, end: &Point, prop: f64) {}
fn intermediate_geodesic(start: &Point, end: &Point, prop: f64) {}
fn intermediate_euclidean(start: &Point, end: &Point, prop: f64) {}
fn intermediate_rhumb(start: &Point, end: &Point, prop: f64) {} |
I spent a while trying to understand our existing "measurement" traits - see the new table in the issue description. It exposes a bit of overlap, some inconsistencies, and some missing functionality. There are also some "similar/related" traits that don't exactly fit the pattern, which I've labeled as "oddballs". |
We have a lot of traits! It took me a while to realize that we had haversine corollaries to these euclidean methods. I think we can arrange things differently to make this more obvious and discoverable to users (like me), like we do with
{Euclidean|Haversine}Length
and{Euclidean|Haversine}Distance
traits.HaversineIntermediate.haversine_intermediate_fill
is the same thing as the existingDensifyHaversine
, right?HaversineIntermediate.haversine_intermediate
is pretty much the haversine corollary to the EuclideanLineInterpolatePoint
Proposal:
Let's delete
HaversineIntermediate
(after a deprecation cycle).HaversineIntermediate .haversine_intermediate
will live on in a new traitHaversineLineInterpolatePoint
that more closely mirrors (Euclidiean)LineInterpolatePoint
andHaversineIntermediate .haversine_intermediate_fill
will go away because it's redundant withDensifyHaversine
.This won't be completely trivial because the API's don't exactly align, but it's not much of a stretch.
One difference:
HaversineIntermediate.haversine_intermediate_fill
takes two points as input, so conceptually it only works on aLine
, whereasDensifyHaversine
is implemented on other geometry types, likePolygon
, but I think that's more of a benefit than anything.Another difference:
HaversineIntermediate.haversine_intermediate_fill
has anincludes_end
parameters. We could add a similar parameter or method flavor to the existing Densify trait to match this new proposed HaversineDensify, but my instinct is actually just to get rid of the parameter and pretend like it's always true. If the user doesn't want the first and last point they can manually trim the output.Also, I think we should rename DensifyHaversine to HaversineDensify to be consistent with most of our other algorithm variants, but I don't feel that strongly about it.
Measurement Trait Matrix
As a csv: measurements.csv
Rendered:
/cc @JivanRoquet original author of the HaversineIntermediate trait in #230
/cc @JosiahParry original author of the DensifyHaversine trait in #1081
The text was updated successfully, but these errors were encountered: