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

228 optimize distance computation #230

Merged
merged 2 commits into from
Nov 17, 2023
Merged

Conversation

nialov
Copy link
Collaborator

@nialov nialov commented Nov 15, 2023

Optimized the performance of distance_computations and added additional test cases.

The optimization was done by first merging the geometries, to which distances are calculated, and then calculating the distance for each raster cell to the merged geometries. The merging is done with unary_union.

Thanks to @AlVella for pointing this possibility out and providing the draft in which this is based on!

The input geometries are now merged using unary_union and the distance
is calculated only once from these merged geometries rather than for
each geometry individually.
Added tests for LineString and Polygon geometry cases.
@nialov nialov linked an issue Nov 15, 2023 that may be closed by this pull request
@nialov nialov requested a review from AlVella November 15, 2023 13:17
Copy link
Collaborator

@nmaarnio nmaarnio left a comment

Choose a reason for hiding this comment

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

LGTM! Do you want to still comment this @AlVella , or will I merge?

Copy link
Collaborator

@AlVella AlVella left a comment

Choose a reason for hiding this comment

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

Looks great to me, got nothing to add.

@nmaarnio nmaarnio merged commit b8d2396 into master Nov 17, 2023
4 checks passed
@nmaarnio nmaarnio deleted the 228-optimize-distance-computation branch November 17, 2023 10:38
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.

Optimize DIstance Computation
3 participants