Skip to content

Dissolve contiguous GeoJSON (Multi)LineStrings and (Multi)Polygons into single units.

Notifications You must be signed in to change notification settings

digidem/geojson-dissolve

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

geojson-dissolve

Build Status npm

Dissolve contiguous GeoJSON (Multi)LineStrings and (Multi)Polygons into single units.

Usage

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]
  ]
}

API

var dissolve = require('geojson-dissolve')

dissolve([geojson]) or dissolve(gj1, gj2, ...)

Consumes a list of homogenous GeoJSON objects, and returns a single GeoJSON Geometry Object, with all touching LineStrings and Polygons dissolved into single geometries.

Install

With npm installed, run

$ npm install geojson-dissolve

License

ISC

About

Dissolve contiguous GeoJSON (Multi)LineStrings and (Multi)Polygons into single units.

Resources

Stars

Watchers

Forks

Packages

No packages published