【问题标题】:Return Coordinates of Address with Apple Maps on Mac在 Mac 上使用 Apple 地图返回地址坐标
【发布时间】:2014-02-24 19:24:26
【问题描述】:

我想使用终端(或 applescript)来获取地址的经纬度。既然 OS X 中有 Apple Maps 应用程序,这在 OS X Mavericks 上是否可行?

【问题讨论】:

  • Maps.app 将其最近的位置、书签等存储在默认设置中。您可以通过“默认读取 com.apple.Maps”查看它们。这就是我所知道的全部。
  • 您的印象是他们将为 maps.app 添加更多的 AS 支持,因为目前,它包含一个做得很好的脚本字典,其中包含所有入门类别,但没有真正的搜索功能新位置或获取当前选定位置的属性。

标签: macos terminal applescript apple-maps


【解决方案1】:

尝试改用 Google Maps API:

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[]'

您可以使用brew install jq 安装jq。或者将jq 命令替换为awk '/^ *"lat"/{print $3;getline;print $3;exit}'

【讨论】:

  • 这就像一个魅力。但是,谷歌有使用限制,我需要拨打数百万个电话。不知道 Open Street Maps 中是否有类似的功能?
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2016-09-09
  • 1970-01-01
  • 2017-11-20
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多