Tag: shapefile

如何迭代node.js中的shapefile

我有以下node.js代码读取基于( https://github.com/mbostock/shapefile )代码的shapefile, var shp=require('shapefile'); var path="polygons.shp" var encoding="utf8" function readRecords(path, encoding) { return function() { var callback = this.callback; shp.read(path, encoding, function(error, header, records) { callback(error, records); }); }; }; var rs = readRecords(path,encoding) console.log(rs) 当我执行上面的代码时,我得到:undefined 任何想法如何迭代这样的对象?