1

I have a database of events (in the UK) and their postcodes (zip codes).

The user will enter their postcode into the webpage and hit enter, some awesome algorithm/system will subsequently return a list of events within x miles driving distance of the user's postcode.

Is this possible in real-time?

The solutions I've considered are:

  • Caching all distances between postcode areas (4100 of them) and using that. Imperfect because postcode areas are a few miles square, but OK for now. The biggest issue is that I'd need approx 8403000 journey distances, and Google Maps has usage restrictions and Map Quest's API is slow, imperfect for looking up postcodes, and I don't want to perform a DOS attack on it.

  • Caching all distances between event postcodes and my list of postcode areas. Still imperfect because there will be 1000s of events and it will take too long to look up distances when adding an event.

  • Limit the amount of journey caching to postcodes within 100 or 200 miles as the crow flies. I've not investigated this, but given the size of the UK it could cut down the total number of journey's required per event by 1/2 or even 2/3... which is better, but will still take too long to lookup when adding an event.

  • Store some sort of graph of postcode locations with journey distances to next postcode area, and use something like A* to search on the fly for close postcodes. The problem with this is that I don't have the time/availability to implement and host a system like this.

Are there better solutions? Have I missed something obvious?


EDIT: MapQuest appears to support driving distance search using custom POI data sets.

Not a duplicate of proximity search as I want driving distance proximity, not latitude/longitude proximity.

Community
  • 1
  • 1
Jon
  • 12,684
  • 4
  • 31
  • 44

2 Answers2

0

I don't know about OpenStreetMap quality in UK, but you could download their data. If data quality is good enough and contains PostalCode information, than you can precalculate all you want using their data without making DOS attack on some online data store.

watbywbarif
  • 6,487
  • 8
  • 50
  • 64
0

As I've added in as an edit:

MapQuest appears to support driving distance search using custom POI data sets.

Unfortunately, as was bound to happen, due to the data limits on MapQuest the customer has decided to use a less interesting solution!

Jon
  • 12,684
  • 4
  • 31
  • 44
  • Just curious, what data limits turned out to be a problem for the customer? – jharahush Mar 09 '12 at 16:12
  • 5000 searches per day. Had another idea though which was to do the search in reverse when you add in an event (ie find nearest postcodes) which would get around the 5000/day limit. – Jon Mar 12 '12 at 15:32