Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
count: 306,
bbox: [-6.13,50.45,1.46,57.29]
}
];
let points = await DummyData.find({}).exec();
if(points.length>200){
return;
}
let allPoints = [];
for(var region in boundingBoxes){
//let points = random.point(230, region.bbox);
let points = turf('points', boundingBoxes[region].count, {
bbox: boundingBoxes[region].bbox
});
for(var index in points.features){
let obj = {"loc":points.features[index].geometry};
allPoints.push(obj); // contains geojson point obj which can be saved in mongoose
}
}
console.log(allPoints[0].loc.coordinates);
DummyData.insertMany(allPoints)
.then(docs => {
console.log(`Added ${docs.length} geo points`);
})
.catch(err => {
import random from '@turf/random'
import isolines from './'
const points = random('point', 100, {
bbox: [0, 30, 20, 50]
})
for (let i = 0; i < points.features.length; i++) {
points.features[i].properties.z = Math.random() * 10;
}
const breaks = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
const lines = isolines(points, breaks, 'temperature')
const properties = {apply: 'all'}
// Properties option
isolines(points, breaks, 'temperature', properties)
isolines(points, breaks, 'temperature', properties, [{name: 'break1'}, {name: 'break2'}])
latlng: [52.499040, 13.418392]
}, {
name: 'Görlitzer Park',
latlng: [52.496912, 13.436738]
}, {
name: 'webkid',
latlng: [52.501106, 13.422061]
}
];
export const mapConfig = {
center: [52.499219, 13.425416],
zoom: 8
};
const points = turfRandom('points', 50000, { bbox: [13.0535, 52.3303, 13.7262, 52.6675] });
export const locations = Immutable.fromJS(points.features.map(feat => feat.geometry.coordinates));
export const scatterPlotData = points.features.map(feat => (
{ position: feat.geometry.coordinates,
radius: 1,
color: [255, 0, 0]
}
));
export function getColor(d) {
const z = d.start[2];
const r = z / 10000;
return [255 * ((1 - r) * 2), 128 * r, 255 * r, 255 * (1 - r)];
}