Skip to main content

Parse OSM Data

Project description

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

Dependencies

Install

You can install osmRoad via pip.

pip install osmRoad

Usage

from osm import parser
from osm import road

parser

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

road

  • 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)

Example

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.

Source Distribution

osmRoad-0.1.tar.gz (3.5 kB view details)

Uploaded Source

Built Distribution

osmRoad-0.1-py3-none-any.whl (5.7 kB view details)

Uploaded Python 3

File details

Details for the file osmRoad-0.1.tar.gz.

File metadata

  • Download URL: osmRoad-0.1.tar.gz
  • Upload date:
  • Size: 3.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/39.1.0 requests-toolbelt/0.8.0 tqdm/4.24.0 CPython/3.6.5

File hashes

Hashes for osmRoad-0.1.tar.gz
Algorithm Hash digest
SHA256 8842398be32a304da69bc05a033a3c576f1c077a6578e87f41a92866e3e88102
MD5 181445908e0ff8f6299c8f527b643991
BLAKE2b-256 65fbf9f89f8d0f587b935301d148283396a711216facb71abce58cd4c94c2c80

See more details on using hashes here.

File details

Details for the file osmRoad-0.1-py3-none-any.whl.

File metadata

  • Download URL: osmRoad-0.1-py3-none-any.whl
  • Upload date:
  • Size: 5.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/39.1.0 requests-toolbelt/0.8.0 tqdm/4.24.0 CPython/3.6.5

File hashes

Hashes for osmRoad-0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 772d375e49f3b401efb824a8f106907b3f5f4b5210c85a898da67106aacda2a7
MD5 8d14b44404b4fc4ad62bf15a9ee9ffdf
BLAKE2b-256 0381c79644bafef0cb9c5531d69b23af7feb6111f3e880951e9864a9bdc9d3df

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page