Q:

Google Maps Android - Checking if you've been here before

I would like to base an app on the ability to record your walks and then calculate how many times you've walked on yeah part of the route before. I can track the route I've walked, but I have no idea where to start making the functions to calculate how many times you been on each part of the route. How would I go about this?
Any help is greatly appreciated. Thank you.

A:

Your question is broad (for example you are not saying how are you storing your data), but I think that the best solution is to implement a small GIS.
If I had to implement your system, I would propose the following:

Use a GIS database to store data. I have worked with spatialite on Android and it gives great performance
Create a "routes" table to store your routes
Create a "points" table to store the significant points of your route (the places you want to check if the user has been before). Each point in this table will be related with a route (with a foreign key)
Each time you need to check "if the user has been there before", you perform a spatial query against the "points" database, for example creating a buffer (using ST_BUFFER) around your current point to create a circle around the point you are currently in, and perform a ST_INTERSECTS with that cicle against the other points in the database (you will want to use spatial indexes to boost performance) to check what points are near (are candidates for the predicate "has been there before")

