index.d.ts 1.4 KB

123456789101112131415161718192021222324252627282930313233
  1. import { Feature, FeatureCollection, MultiPolygon, Point, Polygon, Units } from "@turf/helpers";
  2. /**
  3. * Takes a set of {@link Point|points} and returns a concave hull Polygon or MultiPolygon.
  4. * Internally, this uses [turf-tin](https://github.com/Turfjs/turf-tin) to generate geometries.
  5. *
  6. * @name concave
  7. * @param {FeatureCollection<Point>} points input points
  8. * @param {Object} [options={}] Optional parameters
  9. * @param {number} [options.maxEdge=Infinity] the length (in 'units') of an edge necessary for part of the
  10. * hull to become concave.
  11. * @param {string} [options.units='kilometers'] can be degrees, radians, miles, or kilometers
  12. * @returns {Feature<(Polygon|MultiPolygon)>|null} a concave hull (null value is returned if unable to compute hull)
  13. * @example
  14. * var points = turf.featureCollection([
  15. * turf.point([-63.601226, 44.642643]),
  16. * turf.point([-63.591442, 44.651436]),
  17. * turf.point([-63.580799, 44.648749]),
  18. * turf.point([-63.573589, 44.641788]),
  19. * turf.point([-63.587665, 44.64533]),
  20. * turf.point([-63.595218, 44.64765])
  21. * ]);
  22. * var options = {units: 'miles', maxEdge: 1};
  23. *
  24. * var hull = turf.concave(points, options);
  25. *
  26. * //addToMap
  27. * var addToMap = [points, hull]
  28. */
  29. declare function concave(points: FeatureCollection<Point>, options?: {
  30. maxEdge?: number;
  31. units?: Units;
  32. }): Feature<Polygon | MultiPolygon> | null;
  33. export default concave;