index.d.cts 1002 B

12345678910111213141516171819202122232425262728
  1. import { FeatureCollection, Point, BBox, Polygon } from 'geojson';
  2. /**
  3. * Takes a collection of points and a bounding box, and returns a collection
  4. * of Voronoi polygons.
  5. *
  6. * The Voronoi algorithim used comes from the d3-voronoi package.
  7. *
  8. * @function
  9. * @param {FeatureCollection<Point>} points points around which to calculate the Voronoi polygons
  10. * @param {Object} [options={}] Optional parameters
  11. * @param {BBox} [options.bbox=[-180, -85, 180, -85]] clipping rectangle, in [minX, minY, maxX, MaxY] order
  12. * @returns {FeatureCollection<Polygon>} a set of polygons, one per input point
  13. * @example
  14. * const options = {
  15. * bbox: [-70, 40, -60, 60]
  16. * };
  17. * const points = turf.randomPoint(100, options);
  18. * const voronoiPolygons = turf.voronoi(points, options);
  19. *
  20. * //addToMap
  21. * const addToMap = [voronoiPolygons, points];
  22. */
  23. declare function voronoi(points: FeatureCollection<Point>, options?: {
  24. bbox?: BBox;
  25. }): FeatureCollection<Polygon>;
  26. export { voronoi as default, voronoi };