我想将一个相对较大的geojson文件(383 MB)转换为topojson,以便与D3.js一起使用它。Large geojson topojson
geo2topo test.json > test.topojson
,也为简化以下命令:我在Mac书临2016运行以下命令
geo2topo test.json > test.topojson -q 10000
他们都产生相同的以下错误:
buffer.js:503 throw new Error('"toString()" failed'); ^
Error: "toString()" failed at Buffer.toString (buffer.js:503:11) at JSON.parse() at ReadStream. (/usr/local/lib/node_modules/topojson/node_modules/topojson-server/bin/geo2topo:107:46) at emitNone (events.js:91:20) at ReadStream.emit (events.js:188:7) at endReadableNT (_stream_readable.js:975:12) at _combinedTickCallback (internal/process/next_tick.js:80:11) at process._tickCallback (internal/process/next_tick.js:104:9)
我看了像this one这样的线程,但还没有找到任何解决方案。请注意,geojson本身格式正确,可以在d3.js中加载,但由于其大小不能在Web应用程序中使用。
我遇到了完全相同的问题。你找到解决方案吗? – normonics
我也被困在这,我的geojson有2GB,可以真正使用一些topojson魔法。 AFAIK,v8无法读取超过256mb的一个gulp(因此既不能节点,也不能geo2topo) –