【问题标题】:Rails Finding towns within a 10 mile radius of postcode. Google maps APIRails 查找邮政编码半径 10 英里范围内的城镇。谷歌地图 API
【发布时间】:2012-01-21 12:47:58
【问题描述】:

我正在使用geocoder gem,想知道是否有办法让所有城市都在半径范围内(带有中心坐标)。

有点像

city = location.cities(100) #all cities within 100km

似乎有一个PHP solution,但我不确定在我的情况下如何使用它。 谢谢!

【问题讨论】:

    标签: ruby-on-rails ruby-on-rails-3 rails-geocoder


    【解决方案1】:

    我不相信 GoogleMap API 提供空间搜索。 Geonames.org 站点发布了这样一个 Web 服务——相关的 Geonames gem 文档有一个特定示例,用于查找纬度/经度附近的地点:

    places_nearby = Geonames::WebService.find_nearby_place_name 43.900120387, -78.882869834
    

    【讨论】:

      猜你喜欢
      • 2011-12-29
      • 1970-01-01
      • 2011-07-28
      • 2012-01-25
      • 2019-10-17
      • 2014-09-09
      • 1970-01-01
      • 2014-11-09
      • 1970-01-01
      相关资源
      最近更新 更多