index.d.ts 1.4 KB

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