Fast and easy OpenStreetMap XML/PBF parser.
It has a simple API and it is fast and easy to use. It also works across multiple CPU/cores for extra speed.
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://bitbucket.org/olt/imposm.parser/src.
- improved regexp based XML coord parser
- prevent mmap overflow in XMLChunker without coord_callback
- successfully parsed whole planet.osm
- first release
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
|Filename, size||File type||Python version||Upload date||Hashes|
|Filename, size imposm.parser-1.0.0.tar.gz (27.6 kB)||File type Source||Python version None||Upload date||Hashes View hashes|