Jump to content

Recommended Posts

Posted
I want to embed a Google map on a web page and show results based on a postcode and a distance from said postcode. Any ideas? :)
Posted

You may find a service to do this. DIY is harder.

Roughly the steps are:

* find a georeferencer - pref one that gives postcode->national grid NOT lat long. This is hard-ish, as the data costs money, though there are free datasets out there, they have a range of issues (dubious provenance, out of date, low accuracy) which may or may not bother you. Last I looked Google did not provide a postcode georeferencing service.

* Georeference your "nearest" locations. Store x,y

* when you get a query, georeference the postcode, and then compare pythagorean distance to all the others, and sort them (can be done entirely in SQL). This isnt fast, but for small datasets (<1k), all optimisations are worthless

* create KML from the results and pass to google maps

 

I'm *very* rusty with the old map work... been out of it a long time, but still maintain a passing interest. You might find that Google needs lat long in KMl, in which case i'd store both nat grid, and ll in your DB. Nat grid is nice as we are a small country we can grid our maps without losing a lot of accuracy. Grid means "distance" and other fun things are easy to calculate.

Posted

Arr.

Looks like you still need to do some georeferencing - though you could do this for very small datasets by firing the postcode at google maps and getting the URL back - but you still need to georeference the "input" postcode (I presume you are doing something like a "storefinder").

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...