Skip to content

Commit

Permalink
Merge pull request #255 from matkoniecz/patch-2
Browse files Browse the repository at this point in the history
try to document use_nodecache.py
  • Loading branch information
lonvia authored Jun 18, 2024
2 parents c962dc4 + be5c616 commit 068e5e3
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion examples/use_nodecache.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
"""
Iterate over all ways (and ways only) using node cache to obtain geometries
"""
import osmium as o
import sys

Expand All @@ -8,7 +11,7 @@ def __init__(self, idx):

def way(self, w):
for n in w.nodes:
loc = idx.get(n.ref)
loc = idx.get(n.ref) # note that cache is used here
print("%d %s" % (w.id, len(w.nodes)))

if len(sys.argv) != 3:
Expand Down

0 comments on commit 068e5e3

Please sign in to comment.