I have a simple Android app that keeps track of users' location, using the following setting of the LocationManager to avoid constant updates and thus battery drain
minTime = 60sec(minimum time interval between location updates)
minDistance = 50m(minimum distance between location updates)
So far so good. However, not unexpectedly, I kind of suffer from the limited accuracies of GPS. Ideally, I would like to identify in which restaurant a user is eating, even if the restaurant is in a shopping mall with other restaurants or other POIs (e.g., shops) nearby. Right now the accuracy is not good enough to make this reliably work.
I wonder if this a common problem and there are tried and tested solutions.
My current approach is to keep a history of a user's last locations. Every time the user is moving - I use the ActivityRecognitionApi for that - I clear the history. As soon as a user is still, I add any new location to the history. To identify a user's location, I simply average the coordinates - using a simple mean (maybe better the median); I'm not far from the equator, it's only for quick testing. The assumption here is, of course, that all coordinates in the current history are indeed coming from the user being still at one location. Another approach might be clustering. With this I wouldn't need the activity recognition, which is also never 100% accurate. But if there is simpler solution out there, I'd be more happy.
The whole thing is just a basic research prototype. So the backend component handling user's history is in Python. Maybe there are good packages out there that can help me here.