-
Notifications
You must be signed in to change notification settings - Fork 58
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
BUG: fix issue with blocks within another blocks #351
Conversation
predicate="intersects", | ||
predicate="within", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
within is faster and with point in polygon results in the same thing
blocks[blocks.geometry.name] = gpd.GeoSeries( | ||
pygeos.polygons(blocks.exterior.values.data), crs=blocks.crs | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I originally did this to cleanup interior after complex dissolve but it seems that GEOS got much better on it so it may not be needed. This is what was causing the issue in the first place, so if we want some cleaning procedure, it needs to be different.
momepy/elements.py
Outdated
bl_ID_to_uID = centroids_w_bl_ID2[[unique_id, id_name]] | ||
|
||
buildings_m = buildings[[unique_id]].merge( | ||
bl_ID_to_uID, on=unique_id, how="left" | ||
) | ||
self.buildings_id = buildings_m[id_name] | ||
self.buildings_id.index = self.buildings.index |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is just a simplification.
Codecov Report
@@ Coverage Diff @@
## main #351 +/- ##
==========================================
- Coverage 95.87% 95.87% -0.01%
==========================================
Files 13 13
Lines 2815 2811 -4
==========================================
- Hits 2699 2695 -4
Misses 116 116
Continue to review full report at Codecov.
|
@martinfleis Should we add a |
Yes. We should also drop python 3.7, can you include that bump in the same one? |
Sure. |
Fixing the case when one block is fully within the exterior of the other. It currently creates overlapping blocks, this should fix it.