New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Location comparing #52
Comments
@yaniv995 I'm not sure it's needed, because of the way it's implemented and the libraries it uses. It uses https://github.com/transistorsoft/react-native-background-geolocation . It records data only when movement occurs ( Also, each location has time - see https://github.com/MohGovIL/hamagen-react-native/blob/master/src/services/SampleService.ts#L54-L55 So latest location is the current location, where you are now. And to calculate a duration, you can use the next location if it's available (means that you already moved). function duration(allLocations, locationIndex) {
if (locationIndex === allLocations.length - 1) {
return 0; // you are here now
}
const locationTime = allLocations[locationIndex].startTime;
const nextLocationTime = allLocations[locationIndex + 1].startTime;
return nextLocationTime - locationTime; // duration at specific point
} |
Ok.
I think you must add the duration parameter to the database, because
without that, i can get potentially wrong result since according to the
health authorities, the duration time is also critical for the decision.
בתאריך יום ב׳, 23 במרץ 2020, 11:04, מאת Dotan Simha <
notifications@github.com>:
… @yaniv995 <https://github.com/yaniv995> I'm not sure it's needed, because
of the way it's implemented and the libraries it uses.
It uses
https://github.com/transistorsoft/react-native-background-geolocation .
It records data only when movement occurs (using accelerometer, gyroscope
and magnetometer according to the docs).
Also, each location has time - see
https://github.com/MohGovIL/hamagen-react-native/blob/master/src/services/SampleService.ts#L54-L55
So latest location is the current location, where you are now.
And to calculate a duration, you can use the next location if it's
available.
function duration(allLocations, locationIndex) {
if (locationIndex === allLocations.length - 1) {
return 0; // you are here now
}
const locationTime = allLocations[locationIndex].startTime;
const nextLocationTime = allLocations[locationIndex + 1].startTime;
return nextLocationTime - locationTime; // duration at specific point
}
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#52 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AO5EVA6E7L26HNT2HHQM2BLRI4QZJANCNFSM4LRWJGIA>
.
|
I think it should be considered and taken into account when calculating the exposure, but it doesn't have to be part of the database... it's a calculated field. |
Ok.
Is it already implemented or you plan to do that?
Regards,
בתאריך יום ב׳, 23 במרץ 2020, 11:12, מאת Dotan Simha <
notifications@github.com>:
… I think it should be considered and taken into account when calculating
the exposure, but it doesn't have to be part of the database... it's a
calculated field.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#52 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AO5EVA44XWXBGOICBI66EYTRI4RZDANCNFSM4LRWJGIA>
.
|
I don't know, I'm just a contributor :) I guess @MiriShalev can answer that |
It seems ok |
Hi,
I'm not sure you save the time that the user stay in each location. It's very important to take it into account because there could be a scenario that user has been within the same location but for few seconds.
The text was updated successfully, but these errors were encountered: