index.d.ts 1.1 KB

123456789101112131415161718192021222324252627
  1. import { MultiLineString, MultiPoint, MultiPolygon, Properties } from "@turf/helpers";
  2. import { Point, LineString, Polygon, FeatureCollection } from "@turf/helpers";
  3. /**
  4. * Combines a {@link FeatureCollection} of {@link Point}, {@link LineString}, or {@link Polygon} features
  5. * into {@link MultiPoint}, {@link MultiLineString}, or {@link MultiPolygon} features.
  6. *
  7. * @name combine
  8. * @param {FeatureCollection<Point|LineString|Polygon>} fc a FeatureCollection of any type
  9. * @returns {FeatureCollection<MultiPoint|MultiLineString|MultiPolygon>} a FeatureCollection of corresponding type to input
  10. * @example
  11. * var fc = turf.featureCollection([
  12. * turf.point([19.026432, 47.49134]),
  13. * turf.point([19.074497, 47.509548])
  14. * ]);
  15. *
  16. * var combined = turf.combine(fc);
  17. *
  18. * //addToMap
  19. * var addToMap = [combined]
  20. */
  21. declare function combine(fc: FeatureCollection<Point | MultiPoint | LineString | MultiLineString | Polygon | MultiPolygon>): FeatureCollection<{
  22. type: "MultiPoint" | "MultiLineString" | "MultiPolygon";
  23. coordinates: number[][] | number[][][] | number[][][][];
  24. }, {
  25. collectedProperties: Properties[];
  26. }>;
  27. export default combine;