문제

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?

도움이 되었습니까?

해결책

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

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top