我在makefile中尝试了以下两个指令:
states_topojson.json: states.shp
node_modules/.bin/topojson \
-o $@
states_topojson.json: states.shp
node_modules/.bin/topojson \
-o $@
--projection='width = 960, height = 600, d3.geo.albersUsa() \
.scale(1280) \
.translate([width / 2, height / 2])' \
--simplify=.5 \
--filter=none \我可以制作其他文件,所以我知道topojson是正确安装在node上的。
我的states.shp文件直接来自Bostock Us-Atlas,由:
make shp/us/states-unfiltered.shp当我尝试运行时:
topojson -o output.json states.shp我听到了这样的声音:
Trace: { [Error: ENOENT, open 'states.dbf'] errno: 34, code: 'ENOENT', path: 'states.dbf' }
at output (/usr/local/lib/node_modules/topojson/bin/topojson:259:29)
at notify (/usr/local/lib/node_modules/topojson/node_modules/queue-async/queue.js:45:26)
at /usr/local/lib/node_modules/topojson/node_modules/queue-async/queue.js:35:11
at /usr/local/lib/node_modules/topojson/bin/topojson:236:23
at /usr/local/lib/node_modules/topojson/node_modules/shapefile/index.js:14:23
at /usr/local/lib/node_modules/topojson/node_modules/shapefile/read.js:26:29
at notify (/usr/local/lib/node_modules/topojson/node_modules/queue-async/queue.js:45:26)
at /usr/local/lib/node_modules/topojson/node_modules/queue-async/queue.js:35:11
at /usr/local/lib/node_modules/topojson/node_modules/shapefile/index.js:45:25
at /usr/local/lib/node_modules/topojson/node_modules/shapefile/dbf.js:16:30将.dbf文件移动到根文件夹可以使topojson命令行工作。但是makefile仍然失败。
发布于 2014-07-21 06:13:03
这可能需要几次迭代。
试试这个makefile (Make是一个工具;makefile是一个读取文件,是一种脚本):
output.json:
topojson -o output.json states.shp告诉我们它是否有效,我们就可以继续了。
https://stackoverflow.com/questions/24846032
复制相似问题