0

I've been using the google distance matrix API, and so far it works very well! However, I've noticed that google put a limit of 1000 requests per day. I am making a program for a website with about 1000 users, and the way I plan to search through all the users would lead to a lot of requests every time someone searched for nearby people.

I was planning to save everyone's location in a database, and then when someone entered their own location, it would compare that location to each and every one in the database. This would lead to potentially hundreds/thousands of requests every time someone searched.

So would there be a better way to do this?

Dtroll MC
  • 303
  • 5
  • 14
  • If your database is MySQL you can use the answer to mysql - Fastest Way to Find Distance Between Two Lat/Long Points - http://stackoverflow.com/questions/1006654/fastest-way-to-find-distance-between-two-lat-long-points – bdsl Jan 19 '15 at 12:21
  • What if I just wanted to save their location, as in (Toronto, Ontario) – Dtroll MC Jan 19 '15 at 12:27

1 Answers1

0

This sounds like a heavy request method you currently doing. And even if you buy the commercial solution I fear you will loose money very quickly.

Instead I suggest that you host a routing server on your own (e.g. GraphHopper where I am the author) and then you can query this until the CPU melts. Also for only a city the hardware requirements are very low.

Karussell
  • 17,085
  • 16
  • 97
  • 197