Skip to main content

No project description provided

Project description

OpenStreetMap Roads

The package takes an openstreetmap pbf file and converts it to a geohash prefix based hdf5 file. It provides an api to then do a fast map matching for any latitude, longitude that comes under the bounding box of the pbf file.

Installation

pip install osm-roads

Importing and loading the pbf file

from osm_roads.osm_roads import OsmRoads

way_finder = OsmRoads() way_finder.load_osm_pbf("bengaluru.pbf")

Search for map matching with latitude and longitude

way_finder.get_road_type(12.934005898750094, 77.61075025215672)

Output

Saving the current PBF to a trie

way_finder.export_trie('bangalore_updated.trie')

Loading the trie from file

way_finder.load_trie('bangalore_updated.trie')

How to get PBF files and slice them

  1. Visit the OpenStreetMap Wiki. The file used in the example is downloaded from GeoFabrik, one of the mirrors of OSM and sliced using Osmium Tool

  2. Install the Osmium Tool (works well in linux). sudo apt-get install -y osmium-tool

  3. Run "osmium extract -b 77.343833,13.159493,77.905509,12.830316 southern-zone-latest.osm.pbf -o bengaluru.pbf" (replace the bounding box lat,lons as per your need)

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

osm_roads-0.24.tar.gz (4.5 kB view hashes)

Uploaded Source

Built Distribution

osm_roads-0.24-py3-none-any.whl (4.4 kB view hashes)

Uploaded Python 3

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