TopoJSON将GeoJSON渲染为墨卡托作为完美的Square,而Albers则使用D3作为完美的圆圈

时间:2015-12-26 12:37:34

标签: d3.js geojson topojson

当我将我的geojson功能添加到svg时,所有功能似乎都融合成某种现代主义,抽象风格的艺术作品。

线索

  1. 当我将投影设置为墨卡托时,结果是完美的方形工艺。 $250
  2. 当我将投影设置为Albers时,结果是完美的循环工作。 $500
  3. Mapshaper.org渲染我的文件很好,因为它必须由某种优越的存在来编码。 enter image description here
  4. 我认为相关的代码

    这是小提琴:https://jsfiddle.net/d5Lqemsq/1/

    d3.json("median_map_2_pct.topojson", function(error, nc) {
      if (error) return console.error(error);
    
    
      var featureCollection = topojson.feature(nc, nc.objects.median_map);
    
      svg.selectAll("path")
        .data(featureCollection.features)
        .enter().append("path")
        .attr("d", path.projection(projection))
    

    感谢您阅读。

0 个答案:

没有答案