geojson-dissolve
Dissolve contiguous GeoJSON LineStrings and Polygons into single units.
Last updated 10 years ago by gmaclennan .
ISC · Repository · Bugs · Original npm · Tarball · package.json
$ npm install geojson-dissolve 
SYNC missed versions from official npm registry.

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

Current Tags

  • 3.1.0                                ...           latest (10 years ago)

4 Versions

  • 3.1.0                                ...           10 years ago
  • 3.0.0                                ...           10 years ago
  • 2.0.0                                ...           10 years ago
  • 1.0.0                                ...           10 years ago
Maintainers (2)
Downloads
Total 12
Today 0
This Week 1
This Month 9
Last Day 0
Last Week 2
Last Month 2
Dependencies (5)
Dev Dependencies (5)
Dependents (1)

© 2010 - cnpmjs.org x YWFE | Home | YWFE