2

I've seen a photo I'd like to trace the location of. In it is a BP garage and a Sainsburys supermarket. Google Maps holds all the info and I'm sure many others do - what I'd like is to be able to quickly do a join-type operation on the data. It would ahve to be proximity limited but if this was using, say, the town name or the first 4 digits of the postcode (UK) that would be fine.

Any ideas?

It'd be great if this could be generalised so for example I could find all campsites with nearby indoor play centres, or whatever?

pbhj
  • 276
  • 3
  • 15
  • well I guess getting the data is the first step. once you've got post codes, you can probably use the googlemaps api to get LatLon coordinates, and should have methods for distance as well. don't know if it's euclidean or manhattan distance you're after...'together' would be small number in both cases I guess – George Profenza Jul 18 '10 at 22:46
  • Well I'm not really bothered about getting the distance like I said 4 digit postcode would be fine to narrow the list, 5 digit would be better. At worst just matching on town names would be better than nothing. It's not the lat-lon calculations that I'd struggle with it's the pairings and the initial data. GoogleMaps gives me a map with all the Sainsburys stores on ... what now? Once I've got the lat-lon worst case would be to do an "inner-join" and calculate all pair distances and then sort by distance. – pbhj Jul 18 '10 at 22:55
  • Seems that Google Places API can return the necessary information, see https://developers.google.com/places/documentation/search. So I need to mine that - which gives lat,lon for locations returned - and then dump the info to a db and do a near match search. Unfortunately I can't search on the whole country but must specify a location and radius <= 50km. – pbhj Mar 11 '13 at 14:13

1 Answers1

0

There absolutely is a way to do this - however, getting your hands on the data is probably going to be more work than actually coding up a solution. Once you've the lat/longs for the 'points of interest', you'd just need to use one of pythagoras' theorem (quick 'n dirty), great-circle distances (slower and less dirty), or driving distances (slow, more realistic - probably overkill) - or alternatively a crude 'what's within a 1km square for this location', very quick and dirtier than the rest, I reckon. :)

Will A
  • 24,780
  • 5
  • 50
  • 61
  • I was kinda hoping for a service to plug into or some code I could run against, say, GoogleMaps API? – pbhj Jul 19 '10 at 14:59