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

Summary at the custom-zone level #327

Closed
CWen001 opened this issue Dec 27, 2021 · 3 comments
Closed

Summary at the custom-zone level #327

CWen001 opened this issue Dec 27, 2021 · 3 comments

Comments

@CWen001
Copy link

CWen001 commented Dec 27, 2021

Thank you very much for this package, and it solves many calculating problems for us who are urban planners but from non-technical backgrounds.

momepy currently provides tools to compute morphological index at the building, tessellation, and street level. It indeed considers the concept of block when constructing one using momepy.Blocks() to integrate the data of buildings, street, and tesselations. However, the morphological index at the block level (or generally zones covering several tesselations or even cut across them) is not yet the central focus.

My question, maybe a request for best practices or functionality, is how can we summarize the index from the current three levels to a custom zoning? For example, after we calculate some indexes at the city level, then we may want to summarize them according to its different districts.

So far, my plan is to use the spatial join tool to add the district information back to buildings, streets, and tesselations within them, and then do some df.groupby('district_id').agg(...) considering mean or weighted mean. But it has potential problems when dealing with cross-boundary entities.

@martinfleis
Copy link
Member

Hi,

this depends on the geometry and the precision you are looking for.

  1. aggregating to blocks from tessellation should be straightforward using block ID attached to tessellation. Tessellation cell is always fully within a single block (if created using momepy.Blocks)
blocks = mm.Blocks(tessellation_df, streets_df, buildings_df, 'bID', 'uID')
tessellation_df["block_id"] = blocks.tessellation_id
tessellation_df.groupby("block_id").agg(...)
  1. aggregating to any other geometry - here you have two options, depending on the precision you want. One is exactly the way you describe - you do the spatial join and aggregation. Yes, it may cause imprecisions in some cases, but when aggregating to large enough areas, that should be negligilble.
  2. The other option is an areal interpolation. That will give you a precise transfer of values from tessellation (or any other polygon geometry) to your target geometry. Your best shot at that is using PySAL's tobler package. See https://pysal.org/tobler/#

@CWen001
Copy link
Author

CWen001 commented Jan 2, 2022

Hi,

Thank you very much for your reply, and It solves my problems. Closing the issue.

Another question, in the long term, is memopy going to extend the metrics to the block level? For example, Number of Road Intersection (RIQ), Road Intersection Separation Distance (RISD), Fractal Dimension at the block level (FDB).

@CWen001 CWen001 closed this as completed Jan 2, 2022
@martinfleis
Copy link
Member

Another question, in the long term, is memopy going to extend the metrics to the block level? For example, Number of Road Intersection (RIQ), Road Intersection Separation Distance (RISD), Fractal Dimension at the block level (FDB).

I am happy to add those. Can you open an issue describing them? To know how are they supposed to be measured. Ideally with some reference to where it comes from.

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

2 participants