Geo-distancing libraries (or whatever they're called)


  • Trolleybus Mechanic

    You know how on some websites you can enter an address, and it will return all records that are near that address, sorted by distance?

    Is there a specific term for that type of search-- and are there any pre-rolled libraries or utilities available out there?


  • Garbage Person

    @Lorne Kates said:

    You know how on some websites you can enter an address, and it will return all records that are near that address, sorted by distance?

    Is there a specific term for that type of search-- and are there any pre-rolled libraries or utilities available out there?

    I don't remember what the name for it is off the top of my head, but I know Google has a web service for it rolled into the Maps Geolocation API.


  • We just call it geodata, or geolocation.

    You can buy datasets that link IP -> lat/long/city/state/country/zip, but I dunno what they cost. Another group in our company provides our database for us for free. If you want to grab the data with something other than an IP, then... I dunno. Browsers have an API for it, if you're on the web.

    SQL Server 2008 has some pretty badass new functions to query locations, take a look.



  • In addition to SQL Server, MySQL has spatial extensions. Taking an address and converting it to a latitude/longitude pair is called georeferencing. You can use Google's Fusion Tables to store your data set, and then use spatial queries to get the records near the address. If you need to get equivalencies, you can use the Google Geocoding API to turn addresses into lat/long values.


  • Trolleybus Mechanic

    Georeferencing! That's the ticket. I'm trying to compare distances by addresses instead of trying to locate an IP. I'm going to give the Google Geocoing API a spin for now just to try it out. There's a queries/24 hour restriction, but if I end up going into anything that even resembles production, I'll look into a paid account or some other service.

    Thanks.



  • Dude, check out Bing Maps...  I'm currently using both their web services (for routing and geocoding) and their ajax client (which is awesome).

    It's free-nintey-nine, unless you use it for internal or pay sites or you go over (I think) 50k requests.  If you buy a license, it's roughly $10-12k per year, but they offer discounts for 2 or 3 year purchases.


Log in to reply