Skip to content

update geo#185

Merged
dabreegster merged 2 commits intoa-b-street:mainfrom
michaelkirk:mkirk/update-geo
Mar 5, 2025
Merged

update geo#185
dabreegster merged 2 commits intoa-b-street:mainfrom
michaelkirk:mkirk/update-geo

Conversation

@michaelkirk
Copy link
Contributor

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:

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.

.get_r(r)
.linestring
.line_interpolate_point(percent)
.point_at_ratio_from_start(&Euclidean, percent)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

.unwrap()
} else {
self.linestring
.point_at_distance_from_end(&Euclidean, meters_away)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.
Copy link
Collaborator

@dabreegster dabreegster left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@dabreegster dabreegster merged commit f4e55b5 into a-b-street:main Mar 5, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants