Quote:I tried to get user street name and matching with my variables but it does not work
Using street name just feel like complicating things.
I would just use GPS user coordinates and calc distances with food shops and return only closest shops.
Distance calculation between 2 GPS coordinates is done with
Great-circle distance - Wikipedia, the free encyclopedia
In order to reduce the number of distance calculations, you need a clever way of storing shops.
- The most simple way is to have all shops in a flat list, downside, you have to calculate distance to every shop every times.
- You can be more efficient by dividing the map in squares and note the square for each shop. Once you know which square you are, you just have to check shops in actual square and squares nearby.
Hilbert curve - Wikipedia, the free encyclopedia