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

时间:2015-04-03 08:10:16

标签: makefile topojson

感谢您阅读本文;我可以使用一些帮助。

我读了这个article,它是关于创建一个makefile来从.shp文件转换topojson文件。我在文章的链接中遵循可下载的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]错误1

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

  • 我在Oracle virtualbox v4.3.26上运行Ubuntu,我的主操作系统是Windows 8 64位。
  • Intel Celeron 1.90 GHz
  • 4.00 GB Ram。

非常感谢您的帮助。

1 个答案:

答案 0 :(得分: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

运行成功:

enter image description here

可视化很好:

enter image description here

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

路要走

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

错误支持

请报告在没有makefile的情况下运行topojson -o counties.json -- counties=gz_2010_us_050_00_20m.shp时收到的错误消息。因此,我们收到topojsonnpm错误,而不是make错误。

下一步

搜索“如何安装topojson + bug”。示例:Trouble installing topojson on ubuntu