Dissolve contiguous GeoJSON (Multi)LineStrings and (Multi)Polygons into single units.
var dissolve = require('geojson-dissolve')
var line1 = {
type: 'LineString',
coordinates: [
[0.0, 0.0],
[1.0, 1.0],
[2.0, 2.0]
]
}
var line2 = {
type: 'LineString',
coordinates: [
[2.0, 2.0],
[3.0, 3.0]
]
}
console.log(dissolve([line1, line2]))
This will output
{
type: 'LineString',
coordinates: [
[0.0, 0.0],
[1.0, 1.0],
[2.0, 2.0],
[3.0, 3.0]
]
}
var dissolve = require('geojson-dissolve')
Consumes a list of homogenous GeoJSON
objects, and returns a single GeoJSON Geometry Object, with all touching LineString
s and Polygon
s dissolved into single geometries.
With npm installed, run
$ npm install geojson-dissolve
ISC