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
28 lines • 785 B
JavaScript
// index.ts
import { coordEach, featureEach } from "@turf/meta";
import { point, featureCollection } from "@turf/helpers";
function explode(geojson) {
const points = [];
if (geojson.type === "FeatureCollection") {
featureEach(geojson, function(feature) {
coordEach(feature, function(coord) {
points.push(point(coord, feature.properties));
});
});
} else if (geojson.type === "Feature") {
coordEach(geojson, function(coord) {
points.push(point(coord, geojson.properties));
});
} else {
coordEach(geojson, function(coord) {
points.push(point(coord));
});
}
return featureCollection(points);
}
var turf_explode_default = explode;
export {
turf_explode_default as default,
explode
};
//# sourceMappingURL=index.js.map