//View Tip #872
Similar Tips
» Bash
» Find last modified files on a filesystem
» My code is compiling
» Remove empty directories
» Find and Grep


Latest tips by RSS
Click here to subscribe
Follow Shell-Fu on Twitter
Click here to follow
Follow Shell-Fu on identi.ca
Click here to follow
The following bash script, which depends on lynx web browser, uses Google's reverse geocode service to find a nearby address given a latitude and longitude pair:

# findnearest
# Usage: findnearest latitude longitude
# Ex.  findnearest  17.976227 -66.111016

result=$(lynx -dump "http://maps.google.com/maps/geo?output=csv&oe=utf-8&ll=$lat,$long")
echo $result | cut -f3- -d,

View Comments »


Add your comment

Comments are currently disabled
Modified a bit to work with wget:

# findnearest
# Usage: findnearest latitude longitude
# Ex.  findnearest  17.976227 -66.111016
wget -q "http://maps.google.com/maps/ge … f-8&ll=$lat,$long" -O -|cut -f3- -d,
Posted 2009-08-19 10:38:36
@Coornail: thanks for the wget-version. it's nicer to look at.
Posted 2009-08-19 14:43:35
Only located city.  Should I have expected a street address?  Fun stuff here at shell-fu.org
Posted 2009-08-27 12:15:31
exec 3<>/dev/tcp/maps.google.com/80
echo -e "GET /maps/geo?output=csv&oe=utf8&ll=$lat,$long HTTP/1.1\n\n">&3
cat <&3
Posted 2009-12-01 12:33:50

Home Latest Browse Top 25 Random Hall Of Fame Contact Submit