index.d.ts 1.3 KB

1234567891011121314151617181920212223242526
  1. import { LineString, MultiLineString, Polygon, MultiPolygon, FeatureCollection, Feature, Point } from 'geojson';
  2. /**
  3. * Takes any LineString or Polygon GeoJSON and returns the intersecting point(s).
  4. *
  5. * @function
  6. * @param {GeoJSON} line1 any LineString or Polygon
  7. * @param {GeoJSON} line2 any LineString or Polygon
  8. * @param {Object} [options={}] Optional parameters
  9. * @param {boolean} [options.removeDuplicates=true] remove duplicate intersections
  10. * @param {boolean} [options.ignoreSelfIntersections=true] ignores self-intersections on input features
  11. * @returns {FeatureCollection<Point>} point(s) that intersect both
  12. * @example
  13. * var line1 = turf.lineString([[126, -11], [129, -21]]);
  14. * var line2 = turf.lineString([[123, -18], [131, -14]]);
  15. * var intersects = turf.lineIntersect(line1, line2);
  16. *
  17. * //addToMap
  18. * var addToMap = [line1, line2, intersects]
  19. */
  20. declare function lineIntersect<G1 extends LineString | MultiLineString | Polygon | MultiPolygon, G2 extends LineString | MultiLineString | Polygon | MultiPolygon>(line1: FeatureCollection<G1> | Feature<G1> | G1, line2: FeatureCollection<G2> | Feature<G2> | G2, options?: {
  21. removeDuplicates?: boolean;
  22. ignoreSelfIntersections?: boolean;
  23. }): FeatureCollection<Point>;
  24. export { lineIntersect as default, lineIntersect };