index.d.ts 969 B

123456789101112131415161718
  1. import { Feature, FeatureCollection, LineString, MultiLineString, MultiPolygon, Point, Polygon } from "@turf/helpers";
  2. /**
  3. * Takes any LineString or Polygon GeoJSON and returns the intersecting point(s).
  4. *
  5. * @name lineIntersect
  6. * @param {GeoJSON} line1 any LineString or Polygon
  7. * @param {GeoJSON} line2 any LineString or Polygon
  8. * @returns {FeatureCollection<Point>} point(s) that intersect both
  9. * @example
  10. * var line1 = turf.lineString([[126, -11], [129, -21]]);
  11. * var line2 = turf.lineString([[123, -18], [131, -14]]);
  12. * var intersects = turf.lineIntersect(line1, line2);
  13. *
  14. * //addToMap
  15. * var addToMap = [line1, line2, intersects]
  16. */
  17. 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): FeatureCollection<Point>;
  18. export default lineIntersect;