index.d.ts 773 B

12345678910111213141516171819202122
  1. /**
  2. * Removes redundant coordinates from any GeoJSON Geometry.
  3. *
  4. * @name cleanCoords
  5. * @param {Geometry|Feature} geojson Feature or Geometry
  6. * @param {Object} [options={}] Optional parameters
  7. * @param {boolean} [options.mutate=false] allows GeoJSON input to be mutated
  8. * @returns {Geometry|Feature} the cleaned input Feature/Geometry
  9. * @example
  10. * var line = turf.lineString([[0, 0], [0, 2], [0, 5], [0, 8], [0, 8], [0, 10]]);
  11. * var multiPoint = turf.multiPoint([[0, 0], [0, 0], [2, 2]]);
  12. *
  13. * turf.cleanCoords(line).geometry.coordinates;
  14. * //= [[0, 0], [0, 10]]
  15. *
  16. * turf.cleanCoords(multiPoint).geometry.coordinates;
  17. * //= [[0, 0], [2, 2]]
  18. */
  19. declare function cleanCoords(geojson: any, options?: {
  20. mutate?: boolean;
  21. }): any;
  22. export default cleanCoords;