【问题标题】:Search four fields in YQL geo.places在 YQL geo.places 中搜索四个字段
【发布时间】:2014-11-11 10:13:05
【问题描述】:

我们目前正在使用 YQL 来查询英国城镇和县的地理数据。目前,我们可以使用以下查询来查找所有名为 Boston 的城镇:

select * from geo.places where text="boston" and placeTypeName="Town"

Demo

问题是,我们希望指定县和国家/地区以生成更具体的结果。我尝试了以下查询,但它返回 0 个结果:

select * from geo.places where (text="boston" and placeTypeName="Town") and (text="lincolnshire" and placeTypeName="County")

Demo

如何查询 3 种字段类型以返回我需要的结果?本质上,我们想查询以下字段:

textplaceTypeName="Town"
textplaceTypeName="County"
textplaceTypeName="Country"

【问题讨论】:

    标签: geolocation yahoo yql


    【解决方案1】:

    这可能是一个选项: https://developer.yahoo.com/blogs/ydnsevenblog/solving-location-based-services-needs-yahoo-other-technology-7952.html

    正如它所提到的: 将文本转换为位置 您还可以使用以下代码将文本(名称)转换为位置:

    yqlgeo.get('paris,fr',function(o){
    
    alert(o.place.name+' ('+
    o.place.centroid.latitude+','+
    o.place.centroid.longitude+
    ')');
    
    })
    

    此包装调用在后台使用我们的 Placemaker 服务并自动为您消除歧义。这意味着巴黎是法国的巴黎,而不是帕丽斯·希尔顿;伦敦是英国伦敦,而不是杰克伦敦。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2011-11-06
      • 1970-01-01
      • 1970-01-01
      • 2016-07-13
      • 2011-09-14
      • 1970-01-01
      • 2017-07-01
      相关资源
      最近更新 更多