Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for Google Takeout Location History (#1160)
* Add support for Google Takeout Location History This adds support for parsing the location history provided by Google Takeout. This makes it possible to convert a month's, year's, or your entire location history at once instead of having to export one day's history at a time on Google Maps. There is documentation in the `xmldoc` folder with some examples. It works great, but there are one, possibly two, other additions I'd like to make in following diffs: 1. Add the ability to select date ranges. For example, I went on a road trip that started in the last week of February, but right now I can only select tracks at the resolution of a whole month. 2. Add support for the higher-resolution "roadSegment" blocks in newer "activitySegment" blocks. This will have to be optional as you have to query the Google Maps API to get lat/long, which costs money. However, if you're willing to pay for it, you can get great detail out of it. They look like this: ``` "roadSegment": [{ "placeId": "ChIJBdXmuuWaK4gRoiClERhZcy8", "duration": "76s" }, { "placeId": "ChIJ4ekNlOWaK4gRxu-moMRFo60", "duration": "58s" }, { "placeId": "ChIJ10qEheWaK4gRQ1T24wEuuN4", "duration": "58s" }, { "placeId": "ChIJe7NWfu-aK4gRFHBB6P0PMe4", "duration": "58s" [...] ``` * rename variable * this TODO is done * now builds on focal, fix documentation * patch -p2 < ~/testo.log * use `&&` instead of `and` for old compilers * don't leak objects when we skip events at exact lat/lon 0/0 * use a reference (even though the compiler would have optimized that away) * rename to googletakeout * fix docs * Address code review requests * add `googletakeout.h` to HEADERS * convert most `#define`s to static members * don't pollute global namespace * rename logging functions * convert some methods to static functions for clang-tidy * `title_case` loop by reference instead of by index (clang-tidy) * better use of debugging levels * drop dead simplifiedRawPath code for now * drop empty tracks * default constructor for GoogleTakeoutInputStream * add some tests that check the content of the data Also, I found some unofficial documentation about the location history format and added that (thanks @CarlosBergillos !) * apply @tsteven4 's patch. thank you!! * add license * fix logging * As I assigned the correct license to my code, I am skeptical that this makes a difference, but give Robert co-copyright. * make the test more boring * rm xml_slice * revert constructor change from @tsteven4 's patch * apply @tsteven4 's latest constructor * apply @tsteven4 's latest patch -- `cmake --build . --target check` passes --------- Co-authored-by: tsteven4 <[email protected]>
- Loading branch information