Client Documentation

Updated 30 January 2008

Calculating Distances

Geocoder.us can now calculate distances between two coordinates, or between two zip codes::

Lat/Long to Lat/Long Distances


http://username:password@geocoder.us/member/service/distance?lat1=38&lat2=39&lng1=-122&lng2=-123

or with the free service (but throttled to one request per 15 seconds):

http://geocoder.us/service/distance?lat1=38&lat2=39&lng1=-122&lng2=-123

Fetching the above URL (go ahead, click on it!) yields the following:

(38, -122) to (39, -123) =  87.7188 miles

Zip Code to Zip Code Distances


http://username:password@geocoder.us/member/service/distance?zip1=95472&zip2=94305

or with the free service (but throttled to one request per 15 seconds):

http://geocoder.us/service/distance?zip1=95472&zip2=94305

Fetching the above URL (go ahead, click on it!) yields the following:

95472, Sebastopol, CA, (38.393314, -122.83666) to 94305, Stanford, CA, (37.427039, -122.16496) =    76.13 miles

This is just a reworking of code I first wrote on Jan 29, 1998. Sadly bit rot means it is not currently online, but it is interesting (to me at least :-) how the 'geek arc' of our lives can circle around and around...forever.

Please let me know help@geocoder.us if you'd like this in a different format, or if you have other needs for 'utility' type geo functions