SafePlaces WebUI <-> SafePaths Point Translation
Overview
Every five minutes the SafePaths GPS application stores a point representing the user’s location.
Scenario – SafePaths user spends an hour at their local grocery store. The SafePaths app ends up collecting a total of twelve points (one for every five minutes at the store).
The user in the above scenario tests positive for covid and uploads their data to the SafePlaces platform for a contact tracing interview. The user’s time at the grocery store in the above scenario should be represented in the contact tracing tool as a single point with a duration of one hour instead of twelve distinct points.
After the interview is completed and the case data is published the data needs to be represented as individual points spanning a duration five minutes.
There is a distinct discrepancy in how points data is collected and how it is to be represented in the SafePlaces UI. We’ll need to implement updates to support points data being represented in a way that both the contact tracing tool and SafePaths app can consume.
Proposed Solution
Ingestion Logic
Points Table
We’ll need to update the points table (in private database) to have the following fields:
id
latitude
longitude
time
duration (represented as number of seconds)
Data Ingestion
When the WebUI service reads newly updated points data from the public database it will perform the following operations before inserting the data into the newly configured points table:
Order ingested points by time
Group points that have the same latitude and longitude whose times are consecutive relative to one another (i.e., 10:05am, 10:10am, 10:15am)
Insert a single record into the points table of the private database for each group of points
Publishing Logic
When published a single point has the potential to be represented as multiple points.
Scenario – a point exists with a time of 10:00am, a duration of 15 minutes, and a lat/long of 71.00/ 72.00. That point will need to be broken down into five minute increments with times relative to one another. The single point then becomes the following three points:
{
latitude: 71.00,
longitude: 72.00,
time: 10:00am
}
{
latitude: 71.00,
longitude: 72.00,
time: 10:05am
}
{
latitude: 71.00,
longitude: 72.00,
time: 10:10am
}
The above points will then be hashed and written to the published file.