通过经纬度在巴基斯坦的Twitter流API [英] Passing Longitude and Latitude in Twitter Streaming API of Pakistan

查看:348
本文介绍了通过经纬度在巴基斯坦的Twitter流API的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在巴基斯坦传递的经度和纬度格式 Twitter的流API 有问题。这个API提供了一些示例例子传递一些城市的经度和纬度。在API的位置例如,对于旧金山的位置下面给出,它工作得很好,我的程序




-122.75,36.8, - 121.75,37.8




但我尝试使用下面的位置,从巴基斯坦得到鸣叫,但服务器将拒绝这个位置。




71.69,32.01,70.69,33.01




请帮我该用逗号分隔的4个值我应该通过,这将让我从巴基斯坦得到的鸣叫。


解决方案

每个包围盒应被指定为一对经度和
纬度对与边框第一次降临
的西南角。




您坐标 71.69,32.01,70.69,33.01的给这个(只似乎是巴基斯坦的一小部分,可能希望有一个更大的方块):





所以我的认为的你框没有被正确形成,因为你没有给左下角它(西南)一角第一。为了正确地给箱坐标,你需要让他们格式为左下角经度,左下角纬度,右上角经度,右上角纬度



尝试使用 70.7,32.1,71.7,33.1 (我四舍五入的数字)而是它会给你最初提出的同一地区:





为了让整个巴基斯坦尝试使用: 62.9,25.2,73.3,35.2 ,给你的区域:





我用本网站为了获得的纬度/经度值。的请注意,该网站给你的纬度,经度但Twitter希望经度,纬度。记住身边交换他们!


I am having problem in passing longitude and latitude format of Pakistan in Twitter Streaming API. This API provides some sample examples of passing longitude and latitude of some cities. The location for San Fransisco in the API location example is given below and it works very well in my program.

-122.75,36.8,-121.75,37.8

But I am trying to use the following location to get tweets from Pakistan but the server rejects this location.

71.69,32.01,70.69,33.01

Kindly help me which 4 values separated by commas I should pass that will allow me to get tweets from Pakistan.

解决方案

Each bounding box should be specified as a pair of longitude and latitude pairs, with the southwest corner of the bounding box coming first.

Your co-ordinates of 71.69,32.01,70.69,33.01 give this (which only seems to be a small part of Pakistan, might want to have a larger box):

So I think you box isn't being formed correctly because you're not giving the bottom left (South West) corner of it first. In order to give the box co-ordinates correctly you need to have them in the format bottom-left-longitude, bottom-left-latitude, top-right-longitude, top-right-latitude.

Try using 70.7,32.1,71.7,33.1 (I've rounded the figures) instead which will give you the same area you suggested originally:

In order to get the whole of Pakistan try using: 62.9,25.2,73.3,35.2 which give you the area:

I use this website in order to get the latitude/longitude values. Note that the website gives you latitude, longitude but Twitter wants longitude, latitude. Remember to swap them around!

这篇关于通过经纬度在巴基斯坦的Twitter流API的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆