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.
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 = 0
def 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.highways
Source and issue tracker
Source code and issue tracker are available at https://github.com/omniscale/imposm-parser.
Changelog
1.0.7 2015-01-10
updated protobuf parser
1.0.6 2014-10-31
fixed bug in protobuf parser that could cause segfaults
1.0.5 2013-09-13
support PBF without granularity value
improved support for non-pretty-printed XML
1.0.4 2012-12-10
improved support for non-pretty-printed XML
fixed dependency check for multiprocessing
1.0.3 2011-07-21
support for uncompressed PBF
bug fix for PBF without dense nodes
1.0.2 2011-03-10
improved regexp based XML coord parser
prevent mmap overflow in XMLChunker without coord_callback
successfully parsed whole planet.osm
1.0.0 2011-02-22
first release
Metadata
Release files for imposm.parser 1.0.7
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| imposm.parser-1.0.7.tar.gz | 37.4 kB | Without provenance | Details for imposm.parser-1.0.7.tar.gz |
Release files / imposm.parser-1.0.7.tar.gz
| Download URL | imposm.parser-1.0.7.tar.gz |
|---|---|
| Size | 37.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6debbfc1cd1cebf15fe3200ddf1cd18c4937aaa4950b4ae3aecb95944789a7dc
|
|
BLAKE2b-256 checksum How to use checksums |
1806df806bca5bd7e05ce20ec10ad6c3041a347f942d7645df469c3c916eee4a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for imposm.parser 1.0.7
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.