index.d.ts 1.2 KB

1234567891011121314151617181920212223242526272829303132
  1. import { Feature, Geometry } from 'geojson';
  2. /**
  3. * Boolean-intersects returns (TRUE) if the intersection of the two geometries is NOT an empty set.
  4. *
  5. * @function
  6. * @param {Geometry|Feature<any>} feature1 GeoJSON Feature or Geometry
  7. * @param {Geometry|Feature<any>} feature2 GeoJSON Feature or Geometry
  8. * @param {Object} [options={}] Optional parameters
  9. * @param {boolean} [options.ignoreSelfIntersections=true] ignore self-intersections on input features
  10. * @returns {boolean} true if geometries intersect, false otherwise
  11. * @example
  12. * var point1 = turf.point([2, 2]);
  13. * var point2 = turf.point([1, 2]);
  14. * var line = turf.lineString([[1, 1], [1, 3], [1, 4]]);
  15. *
  16. * turf.booleanIntersects(line, point1);
  17. * //=false
  18. *
  19. * turf.booleanIntersects(line, point2);
  20. * //=true
  21. *
  22. * //addToMap
  23. * var addToMap = [point1, point2, line];
  24. * point1.properties['marker-color'] = '#f00'
  25. * point2.properties['marker-color'] = '#0f0'
  26. */
  27. declare function booleanIntersects(feature1: Feature<any> | Geometry, feature2: Feature<any> | Geometry, { ignoreSelfIntersections, }?: {
  28. ignoreSelfIntersections?: boolean;
  29. }): boolean;
  30. export { booleanIntersects, booleanIntersects as default };