How to troubleshoot topojson error: distance is not defined

百般思念 提交于 2019-12-12 03:56:42

问题


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 ...

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


回答1:


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.



来源:https://stackoverflow.com/questions/16364671/how-to-troubleshoot-topojson-error-distance-is-not-defined

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!