title: d3.js mercator projection to NYC map
body: <p>I am making a map of the boroughs in NYC and I can't seem to get the projection right: the only thing I get is a tiny map. </p>
  
  <p>I tried recreating <a href="http://bl.ocks.org/mbostock/5126418" rel="nofollow noreferrer">this</a> example, which only made the console go crazy with errors, I suspect because there was something off about the equation.</p>
  
  <p>When I was trying to get albers to work, I tried out the answer to <a href="https://stackoverflow.com/questions/9628382/scaling-d3-js-projections">this</a> question, and still I could not get the map to work.</p>
  
  <pre><code>  With 960/500 height and width, I used: var projection = d3.geo.albers().center([40.71, 73.98]).parallels([29.5, 45.5]).scale(10000).translate([(width) / 2, (height)/2]);
  </code></pre>
  
  <p>Right now, I am using a transverse Mercator, with the code below, and the topojson I created using one of <a href="http://nycdata.pediacities.com/group/nyc-shape-files" rel="nofollow noreferrer">these</a> files.</p>
  
  <pre><code>  var width = 960,
     height = 500;
  
    var svg = d3.select("body").append("svg")
      .attr("width", width)
      .attr("height", height);
  
    d3.json("nyc-borough.json", function(error, nyb) {
  
    var boroughs = topojson.feature(nyb, nyb.objects["nyc-borough-boundaries-polygon"]).features;
  
    var projection = d3.geo.transverseMercator()
  .scale(1600)
  .rotate([73 + 58 / 60, -48 - 47 / 60]);
  
  var path = d3.geo.path()
  .projection(projection);
  
  var g = svg.append("g");
  
  g.append("g")
  .attr("id", "boroughs")
  .selectAll(".state")
  .data(boroughs)
  .enter().append("path")
  .attr("class", function(d){ return d.properties.name; })
  .attr("d", path);
  
  });
  </code></pre>
  
  <p>Please, please halp :( </p>
  
  <p>Thanks in advance!</p>