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

问题描述

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



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

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

解决方案

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的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-27 03:41