| 1234567891011121314151617181920212223242526272829303132333435363738 |
- import { FeatureCollection, Point, GeoJsonProperties, MultiLineString } from 'geojson';
- /**
- * Takes a grid {@link FeatureCollection} of {@link Point} features with z-values and an array of
- * value breaks and generates [isolines](https://en.wikipedia.org/wiki/Contour_line).
- *
- * @function
- * @param {FeatureCollection<Point>} pointGrid input points
- * @param {Array<number>} breaks values of `zProperty` where to draw isolines
- * @param {Object} [options={}] Optional parameters
- * @param {string} [options.zProperty='elevation'] the property name in `points` from which z-values will be pulled
- * @param {Object} [options.commonProperties={}] GeoJSON properties passed to ALL isolines
- * @param {Array<Object>} [options.breaksProperties=[]] GeoJSON properties passed, in order, to the correspondent isoline;
- * the breaks array will define the order in which the isolines are created
- * @returns {FeatureCollection<MultiLineString>} a FeatureCollection of {@link MultiLineString} features representing isolines
- * @example
- * // create a grid of points with random z-values in their properties
- * var extent = [0, 30, 20, 50];
- * var cellWidth = 100;
- * var pointGrid = turf.pointGrid(extent, cellWidth, {units: 'miles'});
- *
- * for (var i = 0; i < pointGrid.features.length; i++) {
- * pointGrid.features[i].properties.temperature = Math.random() * 10;
- * }
- * var breaks = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
- *
- * var lines = turf.isolines(pointGrid, breaks, {zProperty: 'temperature'});
- *
- * //addToMap
- * var addToMap = [lines];
- */
- declare function isolines(pointGrid: FeatureCollection<Point>, breaks: number[], options?: {
- zProperty?: string;
- commonProperties?: GeoJsonProperties;
- breaksProperties?: GeoJsonProperties[];
- }): FeatureCollection<MultiLineString, GeoJsonProperties>;
- export { isolines as default, isolines };
|