gpt4 book ai didi

data-visualization - Topojson - 新加坡和香港的弧

转载 作者:行者123 更新时间:2023-12-04 04:41:24 24 4
gpt4 key购买 nike

我在 https://github.com/mbostock/topojson/tree/master/examples 注意到 world-110m.json 和 world-110m2.json没有通往新加坡和香港的道路。我查看了生成 world-110m.json 文件的 Natural Earth 数据集,并注意到在 tiny_countries 文件中列出了新加坡,但只是作为一个点,而不是作为一个多边形。正常国家/地区文件似乎不包括新加坡。但是,请注意 http://techslides.com/d3-world-maps-tooltips-zooming-and-queue/新加坡不是一个点,而是一条路。

我注意到上面的链接有新加坡和香港的路径。但是,由于一些复杂的代码,我在使用该页面中的文件时遇到了一些问题,并且更愿意手动插入弧线。

谢谢!

最佳答案

好的,找到了解决办法💡

1) 从自然地球获取这个特定的 admin-0 国家 shapefile zip Admin - 0 Countries | Download countries https://www.naturalearthdata.com/downloads/10m-cultural-vectors/

2) 上传 5mb ne_10m_admin_0_countries.zip您从 Natural Earth 下载的 shapefile zip 到 https://mapshaper.org/

enter image description here

使用鼠标拖动并使用滚轮或加号按钮进行缩放并注意香港和新加坡都作为形状/多边形存在于此 shapefile 中:

香港

Hong Kong

新加坡

Singapore

3)在mapshaper中,点击simplify然后检查 prevent shape removal在弹出的简化菜单中

enter image description here

4)简化您的地理,然后将其导出到topojson。 1% 的简化接近于 ~500k原始文件大小 world-110m2.json文件(已编辑)
由此产生的“为小国保留形状的整体值(value)”topojson 文件在此 github 存储库中共享 https://github.com/micahstubbs/tiny-countries-geo/tree/master/out

files

关于data-visualization - Topojson - 新加坡和香港的弧,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26655963/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com