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
32 lines (29 loc) • 1.52 kB
text/typescript
import { GeoJSON, GeometryCollection } from 'geojson';
import { Units } from '@turf/helpers';
/**
* Moves any geojson Feature or Geometry of a specified distance along a Rhumb Line
* on the provided direction angle.
*
* @function
* @param {GeoJSON|GeometryCollection} geojson object to be translated
* @param {number} distance length of the motion; negative values determine motion in opposite direction
* @param {number} direction of the motion; angle from North in decimal degrees, positive clockwise
* @param {Object} [options={}] Optional parameters
* @param {Units} [options.units='kilometers'] in which `distance` will be express; miles, kilometers, degrees, or radians
* @param {number} [options.zTranslation=0] length of the vertical motion, same unit of distance
* @param {boolean} [options.mutate=false] allows GeoJSON input to be mutated (significant performance increase if true)
* @returns {GeoJSON|GeometryCollection} the translated GeoJSON object
* @example
* var poly = turf.polygon([[[0,29],[3.5,29],[2.5,32],[0,29]]]);
* var translatedPoly = turf.transformTranslate(poly, 100, 35);
*
* //addToMap
* var addToMap = [poly, translatedPoly];
* translatedPoly.properties = {stroke: '#F00', 'stroke-width': 4};
*/
declare function transformTranslate<T extends GeoJSON | GeometryCollection>(geojson: T, distance: number, direction: number, options?: {
units?: Units;
zTranslation?: number;
mutate?: boolean;
}): T;
export { transformTranslate as default, transformTranslate };