index.d.ts 1.2 KB

12345678910111213141516171819202122232425262728
  1. import { FeatureCollection, Polygon } from 'geojson';
  2. /**
  3. * Dissolves a FeatureCollection of {@link Polygon} features, filtered by an optional property name:value.
  4. * Note that {@link MultiPolygon} features within the collection are not supported
  5. *
  6. * @function
  7. * @param {FeatureCollection<Polygon>} featureCollection input feature collection to be dissolved
  8. * @param {Object} [options={}] Optional parameters
  9. * @param {string} [options.propertyName] features with the same `propertyName` value will be dissolved.
  10. * @returns {FeatureCollection<Polygon>} a FeatureCollection containing the dissolved polygons
  11. * @example
  12. * var features = turf.featureCollection([
  13. * turf.polygon([[[0, 0], [0, 1], [1, 1], [1, 0], [0, 0]]], {combine: 'yes'}),
  14. * turf.polygon([[[0, -1], [0, 0], [1, 0], [1, -1], [0,-1]]], {combine: 'yes'}),
  15. * turf.polygon([[[1,-1],[1, 0], [2, 0], [2, -1], [1, -1]]], {combine: 'no'}),
  16. * ]);
  17. *
  18. * var dissolved = turf.dissolve(features, {propertyName: 'combine'});
  19. *
  20. * //addToMap
  21. * var addToMap = [features, dissolved]
  22. */
  23. declare function dissolve(fc: FeatureCollection<Polygon>, options?: {
  24. propertyName?: string;
  25. }): FeatureCollection<Polygon>;
  26. export { dissolve as default, dissolve };