iduedu.clip_urban_graph

iduedu.clip_urban_graph(graph_gdf, polygon)[source]

Clip graph nodes by geometry and keep only edges with retained endpoints.

polygon follows the rule of territory in the graph builders: a shapely geometry is in EPSG:4326 (longitude, latitude); a GeoSeries or GeoDataFrame carries its own CRS. Either is reprojected to the graph CRS. Node ids are preserved; call relabel_urban_graph() if dense labels are needed.

Return type:

UrbanGraph

Parameters: