schollz / find

High-precision indoor positioning framework for most wifi-enabled devices.
https://www.internalpositioning.com/
GNU Affero General Public License v3.0
5.04k stars 369 forks source link

Get location history with /location #131

Closed schollz closed 7 years ago

victorhooi commented 7 years ago

Just out of curiosity - was there a reason this ticket was closed?

I checked the API docs - https://www.internalpositioning.com/api/#get-location - and it seems like GET /location doesn't currently return history - so I'm guessing you didn't end up doing this?

I would love to see history - is the current approach to just poll the server on a periodic basis (e.g. every 30 seconds) to pull current location of all devices? Or is there maybe a better way? (Some way of publishing it?).

schollz commented 7 years ago

@victorhooi There is not yet a way of publishing the history but you can use GET /location to retrieve the history. Just use /location?group=GROUP&n=100 to get the last 100 records for every user.

victorhooi commented 7 years ago

Interesting - so we do store historical location records keyed by user?

Is there any way to get the state at a given time? (e.g. here were the X devices detected, and their locations at ?)

Curious also on your thoughts of if BoltDB is the best place to store time-series historical location data, or something more time-series oriented like InfluxDB would work for that part?

schollz commented 7 years ago

Yes, historical locations are all stored. To get states at a given time you have to search through them - there is no way to do this in BoltDB except parsing all.

In retrospect I think something like InfluxDB would be great, but I don't have plans to do a rewrite for that.