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

Edge case when the number of parcels in voronoi exceeds number of buildings in block #122

Open
nmarchio opened this issue Jan 31, 2023 · 0 comments

Comments

@nmarchio
Copy link
Member

nmarchio commented Jan 31, 2023

Sometimes the number of parcel geometries in voronoi exceeds number of building geometries in block. This is fairly rare (under 5% of blocks and usually only a difference of 1).

Cause of unexpected behavior is here: https://github.com/mansueto-institute/kblock/blob/main/kblock/batch_4_compute_k.py#L134

Because very rarely:
np.sum(pygeos.get_num_geometries(block_parcels)) > len(pygeos.get_num_geometries(block_parcels))

To rectify this issue, just change line 134 and other spots to len(pygeos.get_num_geometries(block_parcels)) for it to equal building geometry count.

Mechanically, what is likely happening is that there are occasionally multi-polygon geometries created in the tessellation process, so a single building can be in a multipart parcel geometry. The way its set up now should not affect K (since multipart parcel geometries are treated together as a group), however it does change the interpretation of the building_layers column to mean "number of parcel geometries in each layer" (instead of number of building geometries in each layer) and the building_count column reflect total number of parcel geometries in block.

At a minimum these columns should be renamed or use length if the conceptual definition should be building based.

See attached CSV for edge case blocks.
check.csv

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

No branches or pull requests

1 participant