 
   point = (node) -> turf.point(projectNode(node))
 
-  linestring = (nodes) -> turf.linestring(projectNode(obj[n]) for n in nodes)
-
-  polygon = (nodes) -> turf.polygon([projectNode(obj[n]) for n in nodes])
+  linestring = (nodes) -> turf.linestring(projectNode(obj["node/#{n}"]) for n in nodes)
+
+  polygon = (nodes) -> turf.polygon([projectNode(obj["node/#{n}"]) for n in nodes])
 
   bboxPoly = turf.polygon([[
     [bbox[0], bbox[1]]


MAXBUFFER = 1024 * 1024 * 64  # 64MB
SAVERAW = process.env.SAVERAW


exec = (cmd, stdin='') ->

    }

  for o in osm.elements
    obj[osmid(o)] = o

  for o in osm.elements
    continue unless o.tags?

    if o.type == 'relation' and o.tags.route == 'hiking'
      routeIds.add(osmid(o))
      for m in o.members
        if m.type == 'way'
          segmentIds.add("way/#{m.ref}")

    if o.type == 'node' and o.tags.natural?
      poi.push(natural(o))
