Skip to main content
Donate to the Python Software Foundation or Purchase a PyCharm License to Benefit the PSF! Donate Now

Parse OSM Data

Project description


Process OSM data with python 3. This project is mainly motivated by openstreetmap.



You can install osmRoad via pip.

pip install osmRoad


from osm import parser
from osm import road


  • load_parse_osm: return bounds, nodes, ways
  • load_parse_osmxy: different from above, return nodes with coodinates


  • extract_connectivity: return the adjecent matrix lil_matrix (without weights)
  • extract_adj: return the adjecent list (without weights)
  • extract_edges: return the edges (without weights)
  • build_graph: return a graph in networkx (with weights)


parsed_osm = parser.load_parse_osmxy(r"osm/Beijing.osm")
r = road.build_graph(parsed_osm)
print(nx.dijkstra_path(r, 296314321, 296314277))
parsed_osm = parser.load_parse_osm(r"osm/Beijing.osm")
m = road.extract_adj(parsed_osm)

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, size & hash SHA256 hash help File type Python version Upload date
osmRoad-0.2-py3-none-any.whl (6.3 kB) Copy SHA256 hash SHA256 Wheel py3
osmRoad-0.2.tar.gz (3.5 kB) Copy SHA256 hash SHA256 Source None

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page