新加坡及其他地区的 twitter4j geo streaming latitude/longitude
twitter4j geo streaming latitude/longitude for Singapore and beyond
虽然它看起来可能与 是同一个问题,但事实并非如此。
我修改了 twitter4j
的流式示例代码并生成了这个:https://www.dropbox.com/s/gj75fghtqy5jajf/tweity.zip?dl=0
可以编译为:
$ javac -classpath twitter4j-core-4.0.4.jar:twitter4j-media-support-4.0.4.jar:twitter4j-async-4.0.4.jar:twitter4j-examples-4.0.4.jar:twitter4j-stream-4.0.4.jar PrintFilterLocationStream.java
和运行与:
java -cp .:twitter4j-core-4.0.4.jar:twitter4j-media-support-4.0.4.jar:twitter4j-async-4.0.4.jar:twitter4j-examples-4.0.4.jar:twitter4j-stream-4.0.4.jar PrintFilterLocationStream "{{-126.562500,30.448674},{-61.171875,44.087585}}"
如果我得到正确的边界框,它工作得很好,见
但是对于新加坡,我已经检查了 http://isithackday.com/geoplanet-explorer/index.php?woeid=24703045 的位置,但不知何故它抱怨它无效。
[输出]:
[Wed Jul 06 05:48:15 SGT 2016]Parameter not accepted with the role. 406:Returned by the Search API when an invalid format is specified in the request.
Returned by the Streaming API when one or more of the parameters are not suitable for the resource. The track parameter, for example, would throw this error if:
The track keyword is too long or too short.
The bounding box specified is invalid.
No predicates defined for filtered resource, for example, neither track nor follow parameter defined.
Follow userid cannot be read.
Latitude/longitude are not valid: 1.31, 103.75, 1.47, 103.87
406:Returned by the Search API when an invalid format is specified in the request.
Returned by the Streaming API when one or more of the parameters are not suitable for the resource. The track parameter, for example, would throw this error if:
The track keyword is too long or too short.
The bounding box specified is invalid.
No predicates defined for filtered resource, for example, neither track nor follow parameter defined.
Follow userid cannot be read.
Latitude/longitude are not valid: 1.31, 103.75, 1.47, 103.87
我也尝试过更大的盒子("{{1,103},{2,104}}"
新加坡),但仍然无效。
我已经根据 http://isithackday.com/geoplanet-explorer/index.php?start=malaysia but it's not valid too. Similarly, "{{ -11.00485, 94.969833},{6.07573, 141.021805}}"
for Indonesia didn't work too (http://isithackday.com/geoplanet-explorer/index.php?start=indonesia).
尝试在马来西亚使用 "{{0.66364, 98.935059},{7.58378, 119.448433}}"
新加坡的 latitude/longitude 值应该是多少?
但是马来西亚或印度尼西亚呢?
是否有 countries/cities 的边界框列表?看起来它很容易成为一个静态列表?
twitter4j
要求的坐标与 http://isithackday.com/geoplanet-explorer/index.php?start=singapore 中显示的相反顺序 ...
新加坡是"{{103.618248,1.1158},{104.40847, 1.47062}}"
马来西亚是"{{98.935059,0.66364},{119.448433,7.58378}}"
对于印度尼西亚,是 "{{94.969833,-11.00485},{141.021805,6.07573}}"
除此之外,对于其他位置,如果 http://isithackday.com/geoplanet-explorer/index.php 显示:
Bounding Box:
NE numA, numB
SW numC, numD
twitter4j
FilterQuery.locations 期望:
{{numD,numC},{numB,numA}}
虽然它看起来可能与
我修改了 twitter4j
的流式示例代码并生成了这个:https://www.dropbox.com/s/gj75fghtqy5jajf/tweity.zip?dl=0
可以编译为:
$ javac -classpath twitter4j-core-4.0.4.jar:twitter4j-media-support-4.0.4.jar:twitter4j-async-4.0.4.jar:twitter4j-examples-4.0.4.jar:twitter4j-stream-4.0.4.jar PrintFilterLocationStream.java
和运行与:
java -cp .:twitter4j-core-4.0.4.jar:twitter4j-media-support-4.0.4.jar:twitter4j-async-4.0.4.jar:twitter4j-examples-4.0.4.jar:twitter4j-stream-4.0.4.jar PrintFilterLocationStream "{{-126.562500,30.448674},{-61.171875,44.087585}}"
如果我得到正确的边界框,它工作得很好,见
但是对于新加坡,我已经检查了 http://isithackday.com/geoplanet-explorer/index.php?woeid=24703045 的位置,但不知何故它抱怨它无效。
[输出]:
[Wed Jul 06 05:48:15 SGT 2016]Parameter not accepted with the role. 406:Returned by the Search API when an invalid format is specified in the request.
Returned by the Streaming API when one or more of the parameters are not suitable for the resource. The track parameter, for example, would throw this error if:
The track keyword is too long or too short.
The bounding box specified is invalid.
No predicates defined for filtered resource, for example, neither track nor follow parameter defined.
Follow userid cannot be read.
Latitude/longitude are not valid: 1.31, 103.75, 1.47, 103.87
406:Returned by the Search API when an invalid format is specified in the request.
Returned by the Streaming API when one or more of the parameters are not suitable for the resource. The track parameter, for example, would throw this error if:
The track keyword is too long or too short.
The bounding box specified is invalid.
No predicates defined for filtered resource, for example, neither track nor follow parameter defined.
Follow userid cannot be read.
Latitude/longitude are not valid: 1.31, 103.75, 1.47, 103.87
我也尝试过更大的盒子("{{1,103},{2,104}}"
新加坡),但仍然无效。
我已经根据 http://isithackday.com/geoplanet-explorer/index.php?start=malaysia but it's not valid too. Similarly, "{{ -11.00485, 94.969833},{6.07573, 141.021805}}"
for Indonesia didn't work too (http://isithackday.com/geoplanet-explorer/index.php?start=indonesia).
"{{0.66364, 98.935059},{7.58378, 119.448433}}"
新加坡的 latitude/longitude 值应该是多少?
但是马来西亚或印度尼西亚呢?
是否有 countries/cities 的边界框列表?看起来它很容易成为一个静态列表?
twitter4j
要求的坐标与 http://isithackday.com/geoplanet-explorer/index.php?start=singapore 中显示的相反顺序 ...
新加坡是"{{103.618248,1.1158},{104.40847, 1.47062}}"
马来西亚是"{{98.935059,0.66364},{119.448433,7.58378}}"
对于印度尼西亚,是 "{{94.969833,-11.00485},{141.021805,6.07573}}"
除此之外,对于其他位置,如果 http://isithackday.com/geoplanet-explorer/index.php 显示:
Bounding Box:
NE numA, numB
SW numC, numD
twitter4j
FilterQuery.locations 期望:
{{numD,numC},{numB,numA}}