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
31 lines (30 loc) • 1.17 kB
TypeScript
import { AllGeoJSON } from "@turf/helpers";
/**
* Takes a GeoJSON Feature or FeatureCollection and truncates the precision of the geometry.
*
* @name truncate
* @param {GeoJSON} geojson any GeoJSON Feature, FeatureCollection, Geometry or GeometryCollection.
* @param {Object} [options={}] Optional parameters
* @param {number} [options.precision=6] coordinate decimal precision
* @param {number} [options.coordinates=3] maximum number of coordinates (primarly used to remove z coordinates)
* @param {boolean} [options.mutate=false] allows GeoJSON input to be mutated (significant performance increase if true)
* @returns {GeoJSON} layer with truncated geometry
* @example
* var point = turf.point([
* 70.46923055566859,
* 58.11088890802906,
* 1508
* ]);
* var options = {precision: 3, coordinates: 2};
* var truncated = turf.truncate(point, options);
* //=truncated.geometry.coordinates => [70.469, 58.111]
*
* //addToMap
* var addToMap = [truncated];
*/
declare function truncate<T extends AllGeoJSON>(geojson: T, options?: {
precision?: number;
coordinates?: number;
mutate?: boolean;
}): T;
export default truncate;