     }
 
   for o in osm.elements
-    obj[o.id] = o
+    obj[osmid(o)] = o
 
   for o in osm.elements
     continue unless o.tags?
 
     if o.type == 'relation' and o.tags.route == 'hiking'
-      routeIds.add(o.id)
+      routeIds.add(osmid(o))
       for m in o.members
         if m.type == 'way'
-          segmentIds.add(m.ref)
+          segmentIds.add("way/#{m.ref}")
 
     if o.type == 'node' and o.tags.natural?
       poi.push(natural(o))


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


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

  route = (relation) ->
    segments = []
    for m in relation.members
      id = "#{m.type}/#{m.ref}"
      if obj[id].type == 'way'
        segments.push(m.ref)

    return {
