GeoJSON文件合并
普通的geoJSON文件合并,只需geojson-merge插件就够了,https://www.npmjs.com/package/@mapbox/geojson-merge
mergeFeatureCollectionStream 合并文件
Merge GeoJSON files containing GeoJSON FeatureCollections into a single stream of a FeatureCollection as a JSON string.
merge 合并GeoJSON数组
Merge a series of GeoJSON objects into one FeatureCollection containing all features in all files. The objects can be any valid GeoJSON root object, including FeatureCollection, Feature, and Geometry types.
合并文件,官网的案例
1
2
3
var geojsonMerge = require('@mapbox/geojson-merge');
var mergedStream = geojsonMerge.mergeFeatureCollectionStream(['features.geojson','others.geojson'])
mergedStream.pipe(process.stdout);