Question

I would like to use terminal (or applescript) to get the lat and long of an address. Is this possible on OS X Mavericks now that there is an Apple Maps app in OS X?

Was it helpful?

Solution

Try to use the Google Maps API instead:

curl -sG --data-urlencode 'address=1600 Pennsylvania Ave NW Washington DC' 'http://maps.googleapis.com/maps/api/geocode/json?sensor=false'|jq '.results[0].geometry.location[]'

You can install jq with brew install jq. Or replace the jq command with awk '/^ *"lat"/{print $3;getline;print $3;exit}'.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top