Getting Drive Distance in Terms of Miles

  • rjjh78

    SSCrazy

    Points: 2534

    I am curious to learn the best way to determine Distance for an application/Database I am developing.  Is there a standard database I need to purchase or download containing all Zip Codes and create a calculation to determine distance?  Or is there some kind of API/Plug-In I should use for Google maps? 

    Looking to learn and understand best practices; many thanks in advance!

  • Sue_H

    SSC Guru

    Points: 89426

    rjjh78 - Tuesday, October 9, 2018 12:10 PM

    I am curious to learn the best way to determine Distance for an application/Database I am developing.  Is there a standard database I need to purchase or download containing all Zip Codes and create a calculation to determine distance?  Or is there some kind of API/Plug-In I should use for Google maps? 

    Looking to learn and understand best practices; many thanks in advance!

    No idea what is the “best” and that’s something you most likely will need to determine…as in what is best for your needs.
    Google, Bing, Mapquest and some others all have distance APIs. They offer some additional info – distances were available in a couple of those listed that I remember. They all have some type of licensing. But that’s one avenue that you may want to check. Just do a search on distance API and you should be able to gather some information on at least a few. 

    Sue

  • Steve Jones – SSC Editor

    SSC Guru

    Points: 713712

    If you want driving, you want an API of some sort. Roads aren’t easily calculated in SQL without lots of data. If you just have zip codes, you’ll get straight line distance, which may or may not be OK. Even then, you need mapping to let you know the long/lat of each zip.

    There is this script, which might help: http://www.sqlservercentral.com/scripts/Miscellaneous/30878/

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply