Created
August 20, 2024 01:03
-
-
Save fhk/c7e5d50e6170858263121667b0001375 to your computer and use it in GitHub Desktop.
gemini_geograph.py
This file contains 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
import momepy | |
import geopandas as gpd | |
def create_graph(linestrings): | |
gdf = gpd.GeoDataFrame(geometry=linestrings) | |
graph = momepy.gdf_to_nx(gdf, approach="primal") | |
return graph |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment