Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

urban-morphology

БесплатноБез исполняемых скриптовНе проверен

Build projected-CRS urban morphology graphs from building footprints and movement segments, including barrier-aware tessellation, place/movement composition…

lza6от lza6★ 19 звёзд на GitHub

Об этом скилле

Urban morphology

Use this skill when the task is to turn building footprints and street-like LineString segments into a place/movement urban morphology graph, or when the task needs one of its three typed relation layers independently. The runtime API is GeoDataFrame-first and can return NetworkX only as a compatibility output. It does not require a notebook, Overture download, live service, or source checkout at execution time.

Read the bundled reference that matches the next decision:

  • references/input-contracts.md — required geometry, ID, CRS, barrier, and output contracts.
  • references/workflows.md — end-to-end, pairwise, and multi-distance recipes.
  • references/troubleshooting.md — validation failures, empty/degraded tessellations, distance surprises, and barrier diagnostics.

Operating surface

Need Entry point What it returns
Complete morphology city2graph.morphology.morphological_graph (nodes, edges) dictionaries, or a deprecated-compatible NetworkX graph
Several network budgets morphological_graphs {float_distance: (nodes, edges)} or {float_distance: nx.Graph}
Place adjacency place_to_place_graph place nodes and touched_to edges
Place/street interface place_to_movement_graph combined nodes and faced_to edges
Street-segment connectivity movement_to_movement_graph movement nodes and connected_to edges
Explicit segment topology segments_to_graph endpoint nodes and segment edges
Standalone tessellation city2graph.utils.create_tessellation polygon cells with tess_id; enclosed cells also have enclosure_index

Prefer GeoDataFrame output. For downstream graph conversion, pass the returned nodes/edges to the package's graph-conversion API rather than relying on the deprecated as_nx argument.

Fast routing rules

  1. Have buildings and segments, and need all three relation types? Call morphological_graph(buildings_gdf, segments_gdf, ...).
  2. Need multiple radii from one center? Call morphological_graphs with a non-empty list/tuple of distances. It computes the movement graph and one reachability field once and reuses the largest-distance tessellation context.
  3. Already have tessellation cells? Use the pairwise functions. Ensure cells have place_id and movement rows have movement_id before calling place_to_movement_graph or place_to_place_graph.
  4. Need a movement topology only? Use segments_to_graph for endpoint topology, or movement_to_movement_graph for the dual graph whose nodes are segments.
  5. Need barriers that are not traversable movement? Supply a boolean non_movement_barrier_col; supply primary_barrier_col separately when a row's alternative geometry should be used as the tessellation/facing geometry. These switches are orthogonal.
  6. Need NetworkX? Prefer the package conversion function after inspecting GeoDataFrame output. as_nx=True remains available but is deprecated; any duplicate_edges=True, as_nx=True combination is invalid.

End-to-end procedure

1. Normalize spatial inputs

  • Load building Polygon/MultiPolygon footprints and movement LineString segments into GeoDataFrames.
  • Reproject every layer and the center point to one suitable projected CRS before any metric distance, centroid, buffer, or tessellation operation. Coordinates in EPSG:4326 are degrees, not meters. The morphology pipeline harmonizes the active segment CRS to the building CRS, but do not rely on that implicit conversion for the center or for an auxiliary barrier column.
  • Ensure segment endpoints that are intended to connect are coordinate-equal; segments_to_graph deduplicates exact endpoint coordinate tuples, not fuzzy near-matches.
  • If segments were reprojected after an auxiliary barrier_geometry column was made, keep that column geometry-aware or rebuild it. The implementation reprojects a CRS-tagged alternative barrier column to the active segment CRS; a CRS-less geometry column adopts the segment CRS.

2. Build the morphology graph

from city2graph.morphology import morphological_graph

nodes, edges = morphological_graph(
    buildings_gdf=buildings,
    segments_gdf=segments,
    center_point=center,       # optional Point/one-row GeoSeries/GeoDataFrame
    distance=500.0,            # optional network budget in projected units
    clipping_buffer=300.0,     # tessellation context beyond the budget
    extent_buffer=100.0,       # independent street-access cap
    primary_barrier_col="barrier_geometry",
    contiguity="queen",
    keep_buildings=True,
    keep_segments=True,
    tolerance=1e-6,
    include_unenclosed_buildings=False,
    tessellation_fallback=False,
    tessellation_n_jobs=1,
)

The pipeline validates and CRS-aligns inputs, assigns movement_id from the segment index on an owned copy, optionally splits barrier-only rows, bui

Полный SKILL.md на GitHub

Установить urban-morphology в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

Вложенные файлы

references/input-contracts.mdreferences/troubleshooting.mdreferences/workflows.md

FAQ

Что делает скилл urban-morphology?

Build projected-CRS urban morphology graphs from building footprints and movement segments, including barrier-aware tessellation, place/movement composition, network-distance filters, fallbacks, and multi-distance outputs.

Как установить скилл urban-morphology?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл urban-morphology запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить urban-morphology с