Skip to content

Sample data

TANG ZhiXiong edited this page Sep 10, 2023 · 3 revisions

stockholm

import osmnx as ox

place ="Stockholm, Sweden"
G = ox.graph_from_place(place, network_type='drive', which_result=2)
save_graph_shapefile_directional(G, filepath='stockholm')

from fmm import FastMapMatch,Network,NetworkGraph,UBODTGenAlgorithm,UBODT,FastMapMatchConfig
dirname = 'stockholm'

network = Network(f"{dirname}/edges.shp","fid","u","v")
print("Nodes {} edges {}".format(network.get_node_count(),network.get_edge_count()))
graph = NetworkGraph(network)
network.dump(f'{dirname}/network.json')
network.export_geojson(f'{dirname}/network.geojson')

network.zip

suzhoubeizhan.zip

Clone this wiki locally