   zoom = d3.behavior.zoom()
       .scaleExtent([1, 1000])
 
+  simplify = d3.geo.transform(
+    point: (x, y, z) ->
+      if z? and z >= f0 / sc / 300
+        [a, b] = projection([x, y])
+        return @stream.point(a, b)
+  )
+
   path = d3.geo.path()
-      .projection(projection)
+      .projection(simplify)
 
   svg = d3.select('body').append('svg')
 



initialize = (db) ->
  segmentLayer = topojson.feature(db.topo, db.topo.objects.segments).features
  segmentMap = index(segmentLayer)


    height = parseInt(d3.select('body').style('height'))

    projection.scale(s0 = d3.min([width / boxWidth, height / boxHeight]))
    f0 = (db.bbox[2] - db.bbox[0]) / boxWidth / s0

    svg.select('.zoomrect')
        .attr('width', width)
