如何解决topojson错误:距离未定义 [英] How to troubleshoot topojson error: distance is not defined

查看:134
本文介绍了如何解决topojson错误:距离未定义的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试创建美国学区的TopoJSON文件.我尝试使用以下批处理脚本将一组三个shapefile尝试合并为一个topojson文件:

I'm attempting to create a TopoJSON file of school districts in the United States. I have a set of three shapefiles that I am attempting to combine into a single topojson file, using the following batch script:

call topojson ^
    -o SDs11_Topo.json ^
    -p NAME ^
    --simplify-proportion .1 ^
    --id-property GEOID ^
    -- ^
    ESDs11.shp ^
    SSDs11.shp ^
    USDs11.shp

运行一段时间后(例如,不是立即)-出现以下输出和错误消息:

After some time running (as in, not immediately) - I am presented with the following output, and error message:

coordinate system: spherical
quantization: maximum error 0.00m (0.00°)

...\npm\node_modules\topojson\lib\topojson\spherical.js:13
  var a = distance(t[0], t[1]),
          ^
ReferenceError: distance is not defined
at ...

如果有帮助,我将正在使用的源shapefile放在 http://jsl6906.net/D3/SDs/

In case it helps, I have placed the source shapefiles I am using at http://jsl6906.net/D3/SDs/

对于解决此错误的任何帮助,将不胜感激

Any help on how to troubleshoot this error would be appreciated

推荐答案

,此错误是由于未运行最新版本的topojson引起的.使用不带任何参数的topojson将返回该库的安装版本.

per @nrabinowitz comment above, this error was caused by not running the latest version of topojson. Using topojson with no arguments will return the installed version of the library.

这篇关于如何解决topojson错误:距离未定义的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆