Skip to content

example generates error #1

@dbro

Description

@dbro

Hello- I'm attempting to use this library, and one of the commands from the example produced an error. Here is what happened:

In [1]: import osmnodepbf.osmnodepbf
In [2]: par = osmnodepbf.osmnodepbf.Parser('sf-bay-area.osm.pbf')

In [3]: tags = par.return_tags(refresh=True)

KeyError Traceback (most recent call last)

/home/src/ in ()

/home/src/osmnodepbf/osmnodepbf.pyc in return_tags(self, refresh)
214 """Returns all the keyvalue pairs in the tag list"""
215 if len(self.tags) == 0 or refresh:
--> 216 self.parse()
217 return self.tags
218

/home/src/osmnodepbf/osmnodepbf.pyc in parse(self, tag, refresh)
111 self.processNodes(pg.nodes,tag)
112 if len(pg.dense.id)>0:
--> 113 self.processDense(pg.dense,tag)
114 return self.nodes
115

/home/src/osmnodepbf/osmnodepbf.pyc in processDense(self, dense, tag)
197 self.tags[node["sky"]].append(node["svl"])
198 except:
--> 199 self.tags[node["sky"]] = [node["svl"]]
200 tagloc+=1
201 if found_tag:

KeyError: 'svl'


The next command in the example (railway stations) worked fine - and took tens of minutes to complete.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions