我如何才能获得Facebook在边界内的位置列表

How can I get list of Facebook places inside bounds

本文关键字:边界 列表 位置 Facebook      更新时间:2023-09-26

我需要接收给定边界(由NE和WS坐标定义)内的facebook位置列表

我从javascript应用程序调用以下fql.query:

 FB.api({
    method: "fql.query",
    query: "SELECT name,description,geometry,latitude,longitude,checkin_count,display_subtext FROM place WHERE latitude < '" + bounds.getNorthEast().lat() + "' and longitude < '" + bounds.getNorthEast().lng() + "' and latitude > '" +  bounds.getSouthWest().lat() + "' and longitude > '" +  bounds.getSouthWest().lng() +"'"
  },
  function(response) {
     /// 
 }

但我收到错误604

Your statement is not indexable. The WHERE clause must contain an indexable column. Such columns are marked with * in the tables linked from http://developers.facebook.com/docs/reference/fql 

据我所见,place表中唯一的索引列http://developers.facebook.com/docs/reference/fql/place/是CCD_ 2。但我看不出有什么办法可以从其他表中得到这个page_id

有没有(也许更简单的)方法可以在给定的范围内接收facebook的位置?

您说得对,不能使用FQL表,因为这些列没有索引
但是您可以尝试Graph API调用来搜索特定位置内的位置
例如-https://graph.facebook.com/search?type=place&中心=37.76,-122.427&距离=1000&access_token=
这是从图形API文档这里-https://developers.facebook.com/docs/reference/api/

我用fql做的,我受到了这个答案的启发:

Facebook地点:订单结果按距离

我不是在边界内搜索,而是在距离中心点的距离内搜索,但使用了fql.query语言:

    FB.api({
      method: "fql.query",
      query: "SELECT page_id, name, description, latitude, longitude, checkin_count, distance(latitude, longitude, '"  + centerlat + "', '" + centerlon + "') FROM place WHERE distance(latitude, longitude, '" + centerlat + "', '" + centerlon + "') < '" + distance +"'" 
      },
      function(response) {
      });

它正是我所需要的——给我一份我可以使用的地方清单。