Skip to content
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

Optimize centroid calculation rubber sheet #5627

Merged
merged 5 commits into from
Apr 19, 2023

Conversation

bmarchant
Copy link
Contributor

Rubbersheeting buildings used the centroid of the polygon as the tie-point but converted the building element into a geos::geom::Geometry object before calling the built-in getCentroid() function. This conversion is heavy so a heuristic approach of using the average of all coordinates in the element, recursively for any relations. While the binary .rs file changed in the AlignApplyCmdTest unit test, the results were the same when the input was rubbersheeted.

While in the ElementGeometryUtils code, the calculateLength function had a similar issue of converting linear ways to geos::geom::Geometry objects. I used simple iterative distance calculations on way segments to replace the conversion.

@bmarchant bmarchant merged commit d4276ba into master Apr 19, 2023
@bmarchant bmarchant deleted the optimize_centroid_calculation_rubber_sheet branch April 19, 2023 14:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant