+ Post New Thread
Results 1 to 10 of 10
Web Development Thread, Embedded Google map with filtering in Coding and Web Development; I want to embed a Google map on a web page and show results based on a postcode and a ...
  1. #1

    Geoff's Avatar
    Join Date
    Jun 2005
    Location
    Fylde, Lancs, UK.
    Posts
    11,800
    Thank Post
    110
    Thanked 582 Times in 503 Posts
    Blog Entries
    1
    Rep Power
    223

    Embedded Google map with filtering

    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?

  2. #2


    tom_newton's Avatar
    Join Date
    Sep 2006
    Location
    Leeds
    Posts
    4,448
    Thank Post
    865
    Thanked 839 Times in 662 Posts
    Rep Power
    194
    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.

  3. #3

    Geoff's Avatar
    Join Date
    Jun 2005
    Location
    Fylde, Lancs, UK.
    Posts
    11,800
    Thank Post
    110
    Thanked 582 Times in 503 Posts
    Blog Entries
    1
    Rep Power
    223
    Ok. I get the gist of that. I dislike having to DIY it too. Any services that are likely to do my job for me?

  4. #4

    Geoff's Avatar
    Join Date
    Jun 2005
    Location
    Fylde, Lancs, UK.
    Posts
    11,800
    Thank Post
    110
    Thanked 582 Times in 503 Posts
    Blog Entries
    1
    Rep Power
    223

  5. Thanks to Geoff from:

    SimpleSi (11th August 2010)

  6. #5


    tom_newton's Avatar
    Join Date
    Sep 2006
    Location
    Leeds
    Posts
    4,448
    Thank Post
    865
    Thanked 839 Times in 662 Posts
    Rep Power
    194
    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").

  7. #6

    Geoff's Avatar
    Join Date
    Jun 2005
    Location
    Fylde, Lancs, UK.
    Posts
    11,800
    Thank Post
    110
    Thanked 582 Times in 503 Posts
    Blog Entries
    1
    Rep Power
    223
    I believe this solves the georeferencing problem?

    The Google Geocoding API - Google Maps API Web Services - Google Code

    and yes, it's a storefinder kind of thing.

  8. #7


    tom_newton's Avatar
    Join Date
    Sep 2006
    Location
    Leeds
    Posts
    4,448
    Thank Post
    865
    Thanked 839 Times in 662 Posts
    Rep Power
    194
    Cool. Will that georeference a single postcode?

    I'd cache your results in your db mind.

  9. #8

    Geoff's Avatar
    Join Date
    Jun 2005
    Location
    Fylde, Lancs, UK.
    Posts
    11,800
    Thank Post
    110
    Thanked 582 Times in 503 Posts
    Blog Entries
    1
    Rep Power
    223
    Would appear to! Try it yourself (open the file in a program that understands UNIX type text files)

    http://maps.google.com/maps/api/geoc...A&sensor=false

    Don't even need an API key

  10. Thanks to Geoff from:

    tom_newton (11th August 2010)

  11. #9


    Join Date
    Feb 2007
    Location
    51.405546, -0.510212
    Posts
    8,134
    Thank Post
    204
    Thanked 2,395 Times in 1,773 Posts
    Rep Power
    705
    There's a really good Google Maps plug-in for jQuery called gMap which should do what you want. See the examples page for info on how to use it.

  12. Thanks to Arthur from:

    tom_newton (11th August 2010)

  13. #10


    tom_newton's Avatar
    Join Date
    Sep 2006
    Location
    Leeds
    Posts
    4,448
    Thank Post
    865
    Thanked 839 Times in 662 Posts
    Rep Power
    194
    Mint. I might now georeference our customer db for a laugh

SHARE:
+ Post New Thread

Similar Threads

  1. MS Word - Embedded E-mail
    By moggy in forum Office Software
    Replies: 8
    Last Post: 2nd February 2009, 10:49 AM
  2. Google map API
    By mossj in forum EduGeek Joomla 1.5 Package
    Replies: 0
    Last Post: 30th January 2009, 04:16 PM
  3. Google Safesearch filtering
    By localzuk in forum South West Grid for Learning (SWGfL)
    Replies: 3
    Last Post: 17th December 2008, 03:50 PM
  4. Embed a google map on a static page?
    By reggiep in forum EduGeek Joomla 1.0 Package
    Replies: 7
    Last Post: 20th May 2008, 03:46 PM
  5. Flash embedded in Excel
    By mitchell1981 in forum Windows
    Replies: 2
    Last Post: 21st November 2007, 10:07 AM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •