Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/omniscale/imposm-parser
Deprecated: Python parser for OpenStreetMap data
https://github.com/omniscale/imposm-parser
maintenance-mode osm python
Last synced: about 2 months ago
JSON representation
Deprecated: Python parser for OpenStreetMap data
- Host: GitHub
- URL: https://github.com/omniscale/imposm-parser
- Owner: omniscale
- License: apache-2.0
- Created: 2012-06-12T16:50:34.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2018-12-18T15:08:31.000Z (over 5 years ago)
- Last Synced: 2024-07-08T09:17:00.453Z (2 months ago)
- Topics: maintenance-mode, osm, python
- Language: C++
- Homepage: http://imposm.org/docs/imposm.parser/latest/
- Size: 85.9 KB
- Stars: 133
- Watchers: 12
- Forks: 57
- Open Issues: 10
-
Metadata Files:
- Readme: README.rst
- Changelog: CHANGES
- License: LICENSE
Awesome Lists containing this project
README
imposm.parser - OpenStreetMap XML/PBF parser for Python
=======================================================``imposm.parser`` is a Python library that parses OpenStreetMap data in `XML `_ and `PBF `_ format.
It has a simple API and it is fast and easy to use. It also works across multiple CPU/cores for extra speed.
.. note::
**Imposm-parser is in maintenance mode and it's unlikely that we will provide any further releases.**It is developed and supported by `Omniscale `_ and released under the `Apache Software License 2.0 `_.
Example
-------Here is an example that parses an OSM file and counts all ways that are tagged as a highway.
::from imposm.parser import OSMParser
# simple class that handles the parsed OSM data.
class HighwayCounter(object):
highways = 0def ways(self, ways):
# callback method for ways
for osmid, tags, refs in ways:
if 'highway' in tags:
self.highways += 1# instantiate counter and parser and start parsing
counter = HighwayCounter()
p = OSMParser(concurrency=4, ways_callback=counter.ways)
p.parse('germany.osm.pbf')# done
print counter.highwaysSource and issue tracker
------------------------Source code and issue tracker are available at ``_.