spatial-topology
БесплатноБез исполняемых скриптовНе проверенBuild and post-process spatial graphs with city2graph proximity, contiguity, tessellation, isochrone, clipping, dual-graph, and geometry utilities.
от lza6★ 19 звёзд на GitHubОб этом скилле
Spatial topology
Use this skill when the task is to turn GeoDataFrames into spatial relations or clean, measure, tessellate, filter, clip, dualize, or plot an existing spatial graph. It is a GeoPandas/NetworkX-first operating layer. Keep node identifiers in the GeoDataFrame index, edge identifiers in the first two levels of a MultiIndex, and preserve a CRS through every operation.
Route the request
- Choose the graph builder.
- Points and local neighbours:
knn_graphorfixed_radius_graph. - Planar proximity hierarchy:
delaunay_graph,gabriel_graph,relative_neighborhood_graph, oreuclidean_minimum_spanning_tree. - Random distance-decay edges:
waxman_graph. - Polygon adjacency:
contiguity_graph. - Polygon-to-point containment:
group_nodes. - Typed layer-to-layer proximity:
bridge_nodes.
- Points and local neighbours:
- Choose the distance model before calling a builder. Use a projected CRS
whose coordinate units match the requested radius, weights, buffers, or
travel thresholds. Select
networkonly when a same-CRS line network is available and its node positions and edge weights are usable. - Choose post-processing. Use
filter_graph_by_distancefor a reachable subgraph,create_isochronefor a polygonal reachable envelope,create_tessellationfor cells,clip_graphfor an area boundary,dual_graphfor edge-as-node topology,remove_isolated_componentsfor largest-component cleanup, andcanonicalize_edges/symmetrize_edgesfor undirected edge-table conventions. - Choose output deliberately. By default builders return
(nodes_gdf, edges_gdf)or typed dictionaries.as_nx=Truereturns NetworkX and is retained for compatibility; the builder APIs mark this option deprecated in favour of conversion utilities.duplicate_edges=Trueis a GeoDataFrame convenience only and is incompatible with directed variants and NetworkX output. - Verify the result. Check CRS, index shape, relation keys,
weight, geometry type, connectedness, and whether infinite network distances or empty/degenerate geometries are expected. Read the focused API and troubleshooting references before changing defaults:
Operating invariants
- A builder uses the input index as node IDs. Its edge GeoDataFrame normally
has a
(source, target)MultiIndex and at leastweightandgeometrycolumns. Edge geometry represents the relationship path, not necessarily the original feature geometry. GraphBuilderpositions ordinary nodes at geometry centroids. A suppliednode_geom_colcan override positions for contiguity and grouping; usingset_point_nodes=Truealso replaces the returned node geometry and stores the original geometry asoriginal_geometry.- Euclidean and Manhattan weights are coordinate-unit distances. Manhattan edge
geometries are L-shaped (
(x1,y1) -> (x2,y1) -> (x2,y2)); Euclidean edges are direct segments. Network weights are shortest-path costs and network edge geometry follows the shortest path when available. - A network metric snaps each sample centroid to its nearest network node; it
does not project the sample onto a network edge. Unreachable pairs receive
infand are excluded by bounded neighbour/radius selection. If both sample endpoints snap to one network node, or no usable path geometry exists, edge geometry falls back to a direct segment. - Spatial predicates, contiguity, clipping, centroids, tessellation, and buffering operate in the coordinates supplied. Geographic longitude/latitude is not a substitute for a projected CRS for map-unit distances or areas.
- Empty inputs are generally returned as typed empty GeoDataFrames/graphs. Too few points take explicit early exits in the point builders. Delaunay family methods still require non-collinear coordinates when they invoke SciPy triangulation; preflight collinear data rather than assuming a silent fallback.
Minimal procedure
from city2graph.proximity import fixed_radius_graph
from city2graph.utils import create_isochrone, filter_graph_by_distance, gdf_to_nx
# Reproject all layers to a CRS with metre-like units before measuring.
points = points.to_crs("EPSG:3857")
nodes, edges = fixed_radius_graph(points, radius=500.0)
graph = gdf_to_nx(nodes=nodes, edges=edges)
reachable = filter_graph_by_distance(
graph, center_point=origin, threshold=1_000.0, edge_attr="weight"
)
For a network metric, first reproject points and network_gdf to the same
projected CRS, confirm the network converts to a graph with pos node
attributes, and decide whether geometry length or a numeric network_weight
column is the intended cost. For a heterogeneous result, inspect the typed
edge dictionary before conversion: relation direction
Установить spatial-topology в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл spatial-topology?
Build and post-process spatial graphs with city2graph proximity, contiguity, tessellation, isochrone, clipping, dual-graph, and geometry utilities.
Как установить скилл spatial-topology?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл spatial-topology запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
theme-factory
Toolkit for styling artifacts with a theme. These artifacts can be slides, docs, reportings, HTML landing pages, etc. There are 10 pre-set themes with…
от Anthropicaccess
Manage Discord channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropicconfigure
Set up the Discord channel — save the bot token and review access policy. Use when the user pastes a Discord bot token, asks to configure Discord, asks "how…
от Anthropicaccess
Manage iMessage channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropic