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

      when 'node'
        f = point(o)
      when 'way'
        f = turf.centroid(segment(o.id))
    f.id = o.id
    f.properties = {
      name: o.tags.name


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


osmid = (o) -> "#{o.type}/#{o.id}"


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