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?

Était-ce utile?

La 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}'.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top