JSPM

@spatial/clean-coords

1.0.3
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 61
  • Score
    100M100P100Q68521F
  • License MIT

turf clean-coords module

Package Exports

  • @spatial/clean-coords

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@spatial/clean-coords) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

@spatial/clean-coords

cleanCoords

Removes redundant coordinates from any GeoJSON Geometry.

Parameters

  • geojson (Geometry | Feature) Feature or Geometry
  • options Object Optional parameters (optional, default {})
    • options.mutate boolean allows GeoJSON input to be mutated (optional, default false)

Examples

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

Returns (Geometry | Feature) the cleaned input Feature/Geometry


This module is part of the Turfjs project, an open source module collection dedicated to geographic algorithms. It is maintained in the Turfjs/turf repository, where you can create PRs and issues.

Installation

Install this module individually:

$ npm install @spatial/clean-coords

Or install the Turf module that includes it as a function:

$ npm install @turf/turf