import { Units } from '@turf/helpers'; import { LineString, MultiLineString, Feature, FeatureCollection, GeometryCollection } from 'geojson'; /** * Divides a {@link LineString} into chunks of a specified length. * If the line is shorter than the segment length then the original line is returned. * * @function * @param {FeatureCollection|Geometry|Feature} geojson the lines to split * @param {number} segmentLength how long to make each segment * @param {Object} [options={}] Optional parameters * @param {Units} [options.units='kilometers'] Supports all valid Turf {@link https://turfjs.org/docs/api/types/Units Units} * @param {boolean} [options.reverse=false] reverses coordinates to start the first chunked segment at the end * @returns {FeatureCollection} collection of line segments * @example * var line = turf.lineString([[-95, 40], [-93, 45], [-85, 50]]); * * var chunk = turf.lineChunk(line, 15, {units: 'miles'}); * * //addToMap * var addToMap = [chunk]; */ declare function lineChunk(geojson: Feature | FeatureCollection | T | GeometryCollection | Feature, segmentLength: number, options?: { units?: Units; reverse?: boolean; }): FeatureCollection; export { lineChunk as default, lineChunk };