 module.exports = ->
   bboxCiucas = [25.8449, 45.4371, 26.0518, 45.5619]
   obj = {}
-  routeIds = []
+  relationIds = []
   wayIds = []
   for o in JSON.parse(fs.readFileSync('data/ciucas.json')).elements
     obj[o.id] = o
     if o.type == 'relation'
-      routeIds.push o.id
+      relationIds.push o.id
     if o.type == 'way'
       wayIds.push o.id
 

  map = {
    topo: topojson.topology(layers, quantization: 1000000)
    bbox: bboxCiucas
  }

  fs.writeFileSync('build/ciucas.json', JSON.stringify(map))


  segment = (id) -> way = obj[id]; return {
    type: 'Feature'
    id: id
    geometry:
      type: 'LineString'
      coordinates: pos(n) for n in way.nodes
  }

  layer = (features) -> {type: 'FeatureCollection', features: features}

  route = (relation) -> {
    segments: m.ref for m in relation.members
    symbol: relation.tags['osmc:symbol']
  }

  layers = {
    segments: layer(segment(id) for id in wayIds)
