ABK07 ABK07 -4 years ago 125
MySQL Question

What is required in order to implement a geo-spatial/proximity search?

I want to better understand what is required in order to implement a geo-spatial (aka proximity) search. I'd appreciate clarification on the following:

  1. Beyond the latitude & longitude for
    corresponding zip codes, what if
    anything, is required?

  2. Can anyone recommend any resources (books,
    websites, etc.) for understanding
    the formulas that can be used to
    calculate proximity such as:
    Haversine, Vincenty, Spherical?

  3. How easy and effective are Mysql's tools for
    implementing proximity searches?

  4. Does Google Maps have an API for
    proximity searches? For example if I
    provide, a zip code can it return
    zip codes within a set radius? I
    searched the Google Maps website but
    found nothing of the sort.


Answer Source
  1. You just need to do a lookup on the zip code against a lat/lon. You can get this data at some of these sites.

  2. This is a good reference for Haversine / great circle calculations.
  3. MySQL apparently has a geometry type that can be used for some of this. There are also other Spatial Database that might be more useful.

  4. I've never heard that it has that capability, but that doesn't mean that it can't. It might be better to look to one of the spatial databases listed at the link above.
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download