index.d.cts 1.1 KB

1234567891011121314151617181920212223242526
  1. import { Feature, LineString } from 'geojson';
  2. import { Coord } from '@turf/helpers';
  3. /**
  4. * Returns true if a point is on a line. Accepts a optional parameter to ignore the
  5. * start and end vertices of the linestring.
  6. *
  7. * @function
  8. * @param {Coord} pt GeoJSON Point
  9. * @param {Feature<LineString>} line GeoJSON LineString
  10. * @param {Object} [options={}] Optional parameters
  11. * @param {boolean} [options.ignoreEndVertices=false] whether to ignore the start and end vertices.
  12. * @param {number} [options.epsilon] Fractional number to compare with the cross product result. Useful for dealing with floating points such as lng/lat points
  13. * @returns {boolean} true/false
  14. * @example
  15. * var pt = turf.point([0, 0]);
  16. * var line = turf.lineString([[-1, -1],[1, 1],[1.5, 2.2]]);
  17. * var isPointOnLine = turf.booleanPointOnLine(pt, line);
  18. * //=true
  19. */
  20. declare function booleanPointOnLine(pt: Coord, line: Feature<LineString> | LineString, options?: {
  21. ignoreEndVertices?: boolean;
  22. epsilon?: number;
  23. }): boolean;
  24. export { booleanPointOnLine, booleanPointOnLine as default };