Currently, in my web app I use W3C Geolocation API and write (send) geolocation data directly to real-time database.
The problem is that the geolocation data is updated every second. This is a very large amount of data in the database.
How to limit geolocation update frequency (how often latitude and longitude values updates) to e.g. once per 1 or 5 minutes?
As a workaround, I can calculate the delta between the returned timestamp values and if the delta is less than 1 or 5 minutes, skip the new geolocation data and don't write (send) it to the database. But this doesn't solve the battery drain issues.
Thanks for the use case description. This seems to be a duplicate of #16. I'll close this issue so that we can consolidate all related discussion in #16.
Currently, in my web app I use W3C Geolocation API and write (send) geolocation data directly to real-time database.
The problem is that the geolocation data is updated every second. This is a very large amount of data in the database.
How to limit geolocation update frequency (how often
latitude
andlongitude
values updates) to e.g. once per 1 or 5 minutes?As a workaround, I can calculate the delta between the returned
timestamp
values and if the delta is less than 1 or 5 minutes, skip the new geolocation data and don't write (send) it to the database. But this doesn't solve the battery drain issues.