turf-simplify

simplify geographic shapes

Turf packages are now namespaced: please use @turf/simplify instead
Last updated 4 years ago by tmcw .
ISC · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install turf-simplify 
SYNC missed versions from official npm registry.

turf-simplify

build status

simplify geographic shapes

turf.simplify(feature, tolerance, highQuality)

Simplifies a Feature containing a LineString or Polygon geometry. Internally uses simplify-js to perform simplification.

Parameters

parameter type description
feature Feature - a LineString or Polygon feature to be simplified
tolerance number - simplification tolerance
highQuality boolean - whether or not to spend more time to create a higher-quality simplification with a different algorithm

Example

var feature = turf.polygon([[
 [-70.603637, -33.399918],
 [-70.614624, -33.395332],
 [-70.639343, -33.392466],
 [-70.659942, -33.394759],
 [-70.683975, -33.404504],
 [-70.697021, -33.419406],
 [-70.701141, -33.434306],
 [-70.700454, -33.446339],
 [-70.694274, -33.458369],
 [-70.682601, -33.465816],
 [-70.668869, -33.472117],
 [-70.646209, -33.473835],
 [-70.624923, -33.472117],
 [-70.609817, -33.468107],
 [-70.595397, -33.458369],
 [-70.587158, -33.442901],
 [-70.587158, -33.426283],
 [-70.590591, -33.414248],
 [-70.594711, -33.406224],
 [-70.603637, -33.399918]
]]);
var tolerance = 0.01;
var simplified = turf.simplify(
 feature, tolerance, false);

//=feature

//=simplified

Installation

Requires nodejs.

$ npm install turf-simplify

Tests

$ npm test

Current Tags

  • 3.0.7-canary.ae89c8b3                                ...           canary (4 years ago)
  • 3.0.12                                ...           latest (4 years ago)

11 Versions

  • 3.0.12 [deprecated]           ...           4 years ago
  • 3.0.10 [deprecated]           ...           4 years ago
  • 3.0.7-canary.ae89c8b3                                ...           4 years ago
  • 3.0.1 [deprecated]           ...           5 years ago
  • 3.0.0-canary.7879bf6c                                ...           5 years ago
  • 3.0.0-canary.2f5f7167                                ...           5 years ago
  • 1.0.3 [deprecated]           ...           6 years ago
  • 1.0.2 [deprecated]           ...           6 years ago
  • 1.0.1 [deprecated]           ...           6 years ago
  • 1.0.0 [deprecated]           ...           6 years ago
  • 0.0.0 [deprecated]           ...           7 years ago
Downloads
Today 31
This Week 64
This Month 31
Last Day 33
Last Week 196
Last Month 821
Dependencies (1)
Dev Dependencies (2)

Copyright 2014 - 2016 © taobao.org |