Enhance options for morphological_graph()#178
Merged
yu-ta-sato merged 2 commits intoJul 1, 2026
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR adds three new optional parameters to
morphological_graph()to make it more configurable, without changing default behaviour:non_movement_barrier_col(str | None, defaultNone): flags a boolean column insegments_gdfmarking rows that should act as barriers only. Flagged segments still shape the tessellation barriers (clipped to the same radius as the buffered movement network), but are excluded from the movement nodes, the movement-to-movement graph, and the network-distance computation. This is orthogonal toprimary_barrier_col, which substitutes geometry for a segment without ever removing it from the movement layer — the new option decides whether a row becomes a movement node at all.tessellation_fallback(bool, defaultFalse): when enabled, falls back to using reachable building footprints directly as place cells if the enclosed tessellation encloses no area (momepyraises"No objects to concatenate") or otherwise yields no cells despite reachable buildings/segments being available. Fallback cells go through the same reachability-budget filtering (network distance +extent_bufferaccess cap) as the primary path, so retention rules stay consistent. With the flag off, behaviour is unchanged and the underlying error still propagates.tessellation_n_jobs(int, default-1): forwards the number of parallel jobs tocreate_tessellation/momepy.enclosed_tessellation. Useful for setting it to1to run serially and avoid oversubscription whenmorphological_graph()is itself invoked from within an outer parallel loop (e.g. batched processing over many centre points).Related Issues
NA
Checklist