I have multiple geojson type: FeatureCollection stored in Mysql. I want to merge two or more geojson in to one FeatureCollection geojson and show in my map. I have already leaflet map ready which can easily showing in map.
I read about Mapbox ‘geojson-merge’ but I unable to understand how use api in to my js or PHP file.
https://github.com/mapbox/geojson-merge
I search it for example on web but unable to find any guide about how to use with my online code.
This tool can combine two or more GeoJSON files into one merged file. Choose two or more files from your computer and then click "Download merged file" to save the results. The tool only accept valid GeoJSON files with a type of FeatureCollection .
You can use it as a command-line tool.
First, install it:
npm install -g geojson-merge
Then to merge two geojson files run:
geojson-merge one.geojson two.geojson > combined.geojson
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With