3.0.12 • Published 10 years ago
turf-concave v3.0.12
turf-concave
turf concave module
turf.concave(points, maxEdge, units)
Takes a FeatureCollection of Point features and returns a concave hull.
Internally, this implements a Monotone chain algorithm.
Parameters
| parameter | type | description |
|---|---|---|
points | FeatureCollection | a FeatureCollection of Point features |
maxEdge | number | the size of an edge necessary for part of the hull to become concave (in miles) |
units | String | used for maxEdge distance (miles or kilometers) |
Example
var points = {
"type": "FeatureCollection",
"features": [
{
"type": "Feature",
"properties": {},
"geometry": {
"type": "Point",
"coordinates": [-63.601226, 44.642643]
}
}, {
"type": "Feature",
"properties": {},
"geometry": {
"type": "Point",
"coordinates": [-63.591442, 44.651436]
}
}, {
"type": "Feature",
"properties": {},
"geometry": {
"type": "Point",
"coordinates": [-63.580799, 44.648749]
}
}, {
"type": "Feature",
"properties": {},
"geometry": {
"type": "Point",
"coordinates": [-63.573589, 44.641788]
}
}, {
"type": "Feature",
"properties": {},
"geometry": {
"type": "Point",
"coordinates": [-63.587665, 44.64533]
}
}, {
"type": "Feature",
"properties": {},
"geometry": {
"type": "Point",
"coordinates": [-63.595218, 44.64765]
}
}
]
};
var hull = turf.concave(points, 1, 'miles');
var resultFeatures = points.features.concat(hull);
var result = {
"type": "FeatureCollection",
"features": resultFeatures
};
//=resultReturns Feature, a Polygon feature
Installation
Requires nodejs.
$ npm install turf-concaveTests
$ npm test3.0.12
10 years ago
3.0.10
10 years ago
3.0.7-canary.ae89c8b3
10 years ago
3.0.7
10 years ago
3.0.5-canary.4f73aa1a
10 years ago
3.0.5
10 years ago
3.0.1
10 years ago
3.0.0-canary.7879bf6c
10 years ago
3.0.0-canary.2f5f7167
10 years ago
1.1.3
11 years ago
1.1.2
11 years ago
1.1.1
11 years ago
1.0.2
11 years ago
1.0.1
11 years ago
1.0.0
11 years ago
0.1.1
12 years ago
0.1.0
12 years ago
0.0.1
12 years ago
0.0.0
12 years ago
