Fire page now shows also false positives
This commit is contained in:
parent
c962d12374
commit
f0bf995584
8 changed files with 77 additions and 49 deletions
|
|
@ -5,6 +5,8 @@
|
|||
import { Meteor } from 'meteor/meteor';
|
||||
import { check } from 'meteor/check';
|
||||
import { NumberBetween } from '/imports/modules/server/other-checks';
|
||||
import L from 'leaflet-headless';
|
||||
import calcUnion from '/imports/ui/components/Maps/SubsUnion/Unify';
|
||||
import FalsePositives from '../FalsePositives';
|
||||
|
||||
const counter = new Counter('countFalsePositives', FalsePositives.find({}));
|
||||
|
|
@ -13,6 +15,33 @@ Meteor.publish('falsePositivesTotal', function total() {
|
|||
return counter;
|
||||
});
|
||||
|
||||
export const whichAreFalsePositives = (fires) => {
|
||||
const group = new L.FeatureGroup();
|
||||
const remap = fires.fetch().map(function remap(doc) {
|
||||
return { location: { lat: doc.lat, lon: doc.lon }, distance: doc.scan };
|
||||
});
|
||||
const result = calcUnion(remap, group, sub => sub);
|
||||
|
||||
const falsePos = FalsePositives.find({
|
||||
geo: {
|
||||
$geoWithin: {
|
||||
$geometry: result[0].geometry
|
||||
}
|
||||
}
|
||||
}, {
|
||||
fields: {
|
||||
geo: 1,
|
||||
// type: 1,
|
||||
// when: 1,
|
||||
fireId: 1
|
||||
}
|
||||
});
|
||||
|
||||
/* console.log(`False positive total: ${falsePos.count()}`);
|
||||
console.log(`False positives: ${JSON.stringify(falsePos.fetch())}`); */
|
||||
return falsePos;
|
||||
};
|
||||
|
||||
const falsePositives = (northEastLng, northEastLat, southWestLng, southWestLat) => {
|
||||
const fires = FalsePositives.find({
|
||||
geo: {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue