 fs = require('fs')
 request = require('request')
 topojson = require('topojson')
+turf = require('turf')
 Q = require('q')
 
 

    }

  layers = {
    segments: layer(segment(id) for id in segmentIds.values())
    poi: layer(natural(id) for id in naturalIds.values())
  }

  return {


  pos = (id) -> node = obj[id]; return [node.lon, node.lat]

  segment = (id) ->
    f = turf.linestring(pos(n) for n in obj[id].nodes)
    f.id = id
    return f

  natural = (id) ->
    node = obj[id]
    f = turf.point([node.lon, node.lat])
    f.id = id
    f.properties = {
      name: node.tags.name
      type: node.tags.natural
    }
    return f

  route = (relation) ->
    segments = []
