.shp 文件上的 Topojson 命令不起作用?

Topojson command on .shp file not working?

感谢阅读本文;我需要一些帮助。

我从 .shp 文件中读取了这个 article, it is about creating a makefile to convert a topojson 文件。我正在按照文章 link 中提供的可下载 Makefile 中包含的步骤进行操作,但是我根本无法创建 .json 文件;它只是没有出现。这些是我要复制的步骤:

    curl -o counties.zip 'http://www2.census.gov/geo/tiger/GENZ2010/gz_2010_us_050_00_20m.zip'
    unzip counties.zip
    touch gz_2010_us_050_00_20m.shp
    topojson -o counties.json -- counties=gz_2010_us_050_00_20m.shp

第 4 步根本不起作用。我没有理由认为 topojson 没有正确安装,尽管我从来没有能够创建 topojson 文件。有什么问题吗?

下载 Makefile 并执行它以转换 topojson 文件后,终端中显示以下消息:

topojson -o counties.json -- counties=gz_2010_us_050_00_20m.shp make: *** [counties.json] Error 1

这些是我的电脑的一些规格:

非常感谢您的提前帮助。

流程验证

你/以下命令是正确的:

curl -o counties.zip 'http://www2.census.gov/geo/tiger/GENZ2010/gz_2010_us_050_00_20m.zip'
unzip counties.zip
touch gz_2010_us_050_00_20m.shp
topojson -o counties.json -- counties=gz_2010_us_050_00_20m.shp

运行 成功:

可视化很好:

文件可见、可检查且可下载there, on jsoneditoronline.org

干得漂亮

您是否曾经通过命令行 topojson 脚本生成过单个 topojson 文件?如果没有,我想 topojson 要么没有安装,要么已经损坏。存在一些依赖性的常见问题。我建议你卸载 topojson,然后重新安装它。

错误报告

请报告当 运行 topojson -o counties.json -- counties=gz_2010_us_050_00_20m.shp 没有 makefile 时收到的错误消息。所以我们得到一个 topojsonnpm 错误,而不是 make 错误。

下一个

搜索 "how to install topojson + bug"。示例:Trouble installing topojson on ubuntu