香港的twitter4j地理流经纬度 [英] twitter4j geo streaming latitude/longitude for Hongkong
问题描述
我正在尝试使用twitter4j的流媒体方法从香港地区捕获推文.但是,无论选择哪种纬度或经度坐标(从 http: //www.latlong.net/convert-address-to-lat-long.html )我总是会收到无效的纬度/经度错误.
I'm trying to capture tweets using twitter4j's streaming methods from the area of Hongkong. However not matter what latitude or longitude coordinates I choose to do so (from http://www.latlong.net/convert-address-to-lat-long.html) I always get invalid latitude/longitude error.
Latitude/longitude are not valid: 22.27, 114.17, 22.35, 114.21
我使用的代码可以正常工作:
The code I use is otherwise working fine:
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);
我想念什么?纬度/经度有没有限制?我已经很注意让西南点排在阵列的首位.
What am I missing? Are there any restrictions on the latitude/longitude? I already took care to have the south-west point come first in the array.
推荐答案
坐标应为{southwestLon,southwestLat},{northeastLon,northeastLat}
https://dev.twitter.com/streaming/overview/request-参数#locations
new double[][]{
new double[]{114.166875d, 22.274286d},
new double[]{114.214683d, 22.351943d}
}
这篇关于香港的twitter4j地理流经纬度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!