twitter4j geo流媒体纬度/经度为香港

时间:2015-06-17 08:19:41

标签: java twitter latitude-longitude twitter4j

我正试图使用​​来自香港地区的twitter4j流媒体方法来捕捉推文。无论我选择这样做的纬度或经度坐标无关紧要(来自http://www.latlong.net/convert-address-to-lat-long.html)我总是得到无效的纬度/经度误差。

Latitude/longitude are not valid: 22.27, 114.17, 22.35, 114.21

我使用的代码工作正常:

    TwitterStream twitterStream = new TwitterStreamFactory(cb.build()).getInstance();
FilterQuery fq = new FilterQuery();
  fq.locations(
                new double[][]{
                new double[]{ 22.274286d, 114.166875d},
                new double[]{22.351943d, 114.214683d}
        });
 twitterStream.addListener(listener);
        twitterStream.filter(fq);

我错过了什么?纬度/经度是否有任何限制?我已经注意让西南点在阵列中排在第一位。

1 个答案:

答案 0 :(得分:1)

坐标应为{southwestLon,southwestLat},{northeastLon,northeastLat}

https://dev.twitter.com/streaming/overview/request-parameters#locations

new double[][]{
                new double[]{114.166875d, 22.274286d},
                new double[]{114.214683d, 22.351943d}
}
相关问题