Skip to Content

Location Tracking

Posted on One min read

Swarm(Foursquare)

Rest API: Yes


OwnTracks

Support MQTT and HTTP/S endpoint data eject.

owntracks-flow
// Query for getting location data
{
    insertDatetime: {
        $gte: ISODate('2017-11-04T15:00:00.000+08:00'),
        $lte: ISODate('2017-11-05T03:00:00.000+08:00')
    }
}

Moment

Moment 会在每次屏幕电量的时候记录手机的使用时间、地点,还可以每天早上分析电量使用截图(手动)来记录 App 使用时间。GPS 位置有偏移,不过还是准确的,可以导出 JSON 格式,然后导入到 MongoDB 作保存和分析用。

Moment for iOS

Photos

SQLite database locally, but the data is very easy to export and transform, also has face information.

/* ---- Photos SQLite Database ---- */

/*  Photos without location information */

SELECT strftime('%Y', datetime(imageDate + 946684800 + 31536000 + 86400, 'unixepoch', 'localtime')) pic_date, count(*) AS Count
FROM RKVersion
WHERE latitude is null
GROUP BY  strftime('%Y', datetime(imageDate + 946684800 + 31536000 + 86400, 'unixepoch', 'localtime'))
ORDER BY  1;

/* count by faces */

SELECT RKFace.personId,
         RKPerson.name,
         count(*) AS Count
FROM RKFace
LEFT JOIN RKPerson
    ON RKFace.personId = RKPerson.modelId
GROUP BY  personId
ORDER BY  3 desc;

/* Latest photos version with geo data */

WITH BASE AS 
    (SELECT masterId,
         max(versionNumber) maxVersion
    FROM RKVersion
    GROUP BY  masterId)
SELECT RKVersion.*
FROM RKVersion
JOIN BASE
    ON RKVersion.masterId = BASE.masterId
        AND RKVersion.versionNumber = BASE.maxVersion
WHERE latitude is NOT null
        AND longitude is NOT null