Kuntal Parbat
Kuntal Parbat

Reputation: 159

How to merge Multiple geojson in to one geojson in one FeatureCollection

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.

Upvotes: 6

Views: 13191

Answers (2)

Christophe CARON
Christophe CARON

Reputation: 31

This tools online works like a charm for me: https://findthatpostcode.uk/tools/merge-geojson

I merged 5 files into one FeatureCollection

Upvotes: 1

kmandov
kmandov

Reputation: 3209

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

Upvotes: 13

Related Questions