   deferred = Q.defer()
   request url, (err, res, body) ->
     if err?
-      deferred.fail(err)
+      deferred.reject(err)
     else
       deferred.resolve(body)
   return deferred.promise


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


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

    q = query(bbox)
    url = "http://overpass-api.de/api/interpreter?data=#{encodeURIComponent(q)}"
    console.log("overpass:", q)
    retry(RETRY, httpGet, url)

  .then (resp) ->
    if SAVERAW?
