node-red-contrib-tak-registration
Version:
A Node-RED node to register to TAK and to help wrap files as datapackages to send to TAK
39 lines (36 loc) • 1.85 kB
text/typescript
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 };