Merged
Conversation
michaelkirk
commented
Mar 5, 2025
| .get_r(r) | ||
| .linestring | ||
| .line_interpolate_point(percent) | ||
| .point_at_ratio_from_start(&Euclidean, percent) |
Contributor
Author
There was a problem hiding this comment.
This is the new api from georust/geo#1321 - it's more explicit about metric space, and also has some new APIs which you can see further down.
michaelkirk
commented
Mar 5, 2025
| .unwrap() | ||
| } else { | ||
| self.linestring | ||
| .point_at_distance_from_end(&Euclidean, meters_away) |
Contributor
Author
There was a problem hiding this comment.
Here's a good use of the new api - we're using distance not ratio and computing from the end not the start.
Note that this method already clamps the output to the linestring.
== Perf
Some big perf wins for the stats/autogen work!
build stats: Hilltown in LAD_Dundee City
time: [890.95 µs 894.88 µs 899.45 µs]
change: [-34.332% -34.080% -33.830%] (p = 0.00 < 0.05)
Performance has improved.
generate auto boundaries (and stats) for all of LAD_Dundee City
time: [192.06 ms 192.32 ms 192.67 ms]
change: [-61.269% -61.036% -60.823%] (p = 0.00 < 0.05)
Performance has improved.
And some modest wins elsewhere...
build map_model: bristol
time: [83.446 ms 83.560 ms 83.688 ms]
change: [-3.4679% -2.8247% -2.2423%] (p = 0.00 < 0.05)
Performance has improved.
a9d79cc to
1b58b24
Compare
dabreegster
approved these changes
Mar 5, 2025
Collaborator
dabreegster
left a comment
There was a problem hiding this comment.
More awesome perf boosts, and the new interpolation APIs are so much more clear! I'll leave some comments on the upstream PR soon. Distinguishing clearly between distances and ratios is very nice; it might work well also for the line split trait API.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Note this includes the as-of-yet unmerged georust/geo#1321 and georust/geo#1322
Primarily this gets us a nice perf boost in the stats calculation:
And some modest wins elsewhere...