If you want to get location accuracy lower than 500m without significantly impacting battery life, you can use region monitoring. There's two paths:
1. Set up a region around the user's current location. If they exit it, note the location and set up another one around that location. This will give you around 100m accuracy, which is the minimum diameter of the monitored region.
2. Set up regions in various cardinal directions that nearly-or-just-barely overlap. If they enter one of those regions, note the location and set up another set around the current location. This can give you something closer to 50m accuracy.
For (2), this is how I did it in the Home Assistant iOS app, largely for zones that people wish to monitor which are smaller than 100m. You can find some of the annoying math here[1] (and there's tests all over for it), the logic for setting up regions here[2], and computing them here[3].
I have underengineered a similar problem with Owntracks, a Python receiver logging the location to a daily GPX file, and a static site generator generating daily map pages out of that data.
My goal was radically different: have everything saved in standard format, along with my other synced personal files, and turned into a static site. The static site is a daily diary augmented with my other activities. Owntracks is multiplatform and absurdly reliable.
datadrivenangel · 4h ago
Very cool. I did a similar but much less engineered and artistically inclined visualization using Bokeh in Python a few years ago: https://github.com/DataDrivenAngel/GDataViz
forever_frey · 6h ago
Looks awesome and I love the approach! About a year ago, I went through pretty much the same process and built Dawarich, although it's only now I'm starting touching the topic of sharing location publicly, not just recording it for further visualization.
1. Set up a region around the user's current location. If they exit it, note the location and set up another one around that location. This will give you around 100m accuracy, which is the minimum diameter of the monitored region.
2. Set up regions in various cardinal directions that nearly-or-just-barely overlap. If they enter one of those regions, note the location and set up another set around the current location. This can give you something closer to 50m accuracy.
For (2), this is how I did it in the Home Assistant iOS app, largely for zones that people wish to monitor which are smaller than 100m. You can find some of the annoying math here[1] (and there's tests all over for it), the logic for setting up regions here[2], and computing them here[3].
[1]: https://github.com/home-assistant/iOS/blob/master/Sources/Sh... [2]: https://github.com/home-assistant/iOS/tree/master/Sources/Ap... [3]: https://github.com/home-assistant/iOS/blob/2dfbe3c0e52a30417...
I have underengineered a similar problem with Owntracks, a Python receiver logging the location to a daily GPX file, and a static site generator generating daily map pages out of that data.
My goal was radically different: have everything saved in standard format, along with my other synced personal files, and turned into a static site. The static site is a daily diary augmented with my other activities. Owntracks is multiplatform and absurdly reliable.
Great work!