Hello,
I'm an OpenStreetMap contributor.
I'm trying to use imposm.parser (1.0.3-1) installed from Ubuntu 12.10 official repositories
(CPU: Intel® Core™2 Duo CPU T8100 @ 2.10GHz × 2 ).
If I use a coords_callback on an .osm file it works fine, but it does not if I parse the same file converted to pbf (with osmconverter), because granularity == None.
- This is the simple script:
# example file
http://download.gfoss.it/osm/osm/regioni/molise.pbffrom imposm.parser import OSMParser
# Simple class that handles the parsed OSM data.
class CoordsCounter(object):
coordsNum = 0
def coords(self, coords):
# callback method for coords
for osm_id, lon, lat in coords:
self.coordsNum += 1
# Instantiate counter and parser and start parsing
counter = CoordsCounter()
p = OSMParser(concurrency=4, coords_callback=counter.coords)
print "Coords in OSM file:"
p.parse('molise.osm')
print counter.coordsNum
print "Coords in PBF file:"
p.parse('molise.pbf')
print counter.coordsNum
- and this the output:
Coords in OSM file:
260467
Coords in PBF file:
Process PBFParserProcess-2:1:
Traceback (most recent call last):
File "/usr/lib/python2.7/multiprocessing/process.py", line 258, in _bootstrap
self.run()
File "/usr/lib/python2.7/dist-packages/imposm/parser/pbf/multiproc.py", line 35, in run
size=pos['blob_size'])
File "/usr/lib/python2.7/dist-packages/imposm/parser/pbf/parser.py", line 72, in parse
self.handle_nodes(reader)
File "/usr/lib/python2.7/dist-packages/imposm/parser/pbf/parser.py", line 83, in handle_nodes
for node in reader.nodes():
File "/usr/lib/python2.7/dist-packages/imposm/parser/pbf/parser.py", line 207, in nodes
last_lat += coord_scale * (lat_offset + (granularity * lats[i]))
TypeError: unsupported operand type(s) for *: 'NoneType' and 'long'
Could you tell me what I am doing wrong?
Thank you for any hint,
Groppo