# cleanCoords
Removes redundant coordinates from any GeoJSON Geometry.
从任何GeoJSON中删除多余的坐标。
> npm install @turf/clean-coords
参数
| 参数 | 类型 | 描述 |
|---|---|---|
| geojson | (Geometry|Feature) | Feature 或 Geometry |
| options | Object | 可选参数:见下文 |
options选项
| 属性 | 类型 | 默认值 | 描述 |
|---|---|---|---|
| mutate | boolean | false | 允许对GeoJSON输入进行修改 |
返回
(Geometry|Feature) - 清理后的 Feature/Geometry
示例
var line = turf.lineString([[0, 0], [0, 2], [0, 5], [0, 8], [0, 8], [0, 10]]);
var multiPoint = turf.multiPoint([[0, 0], [0, 0], [2, 2]]);
turf.cleanCoords(line).geometry.coordinates;
//= [[0, 0], [0, 10]]
turf.cleanCoords(multiPoint).geometry.coordinates;
//= [[0, 0], [2, 2]]