简体   繁体   English

一条推文的地理位置

[英]Geolocation of a tweet

I am using Tweepy (python) to access to Twitter Search API, and I am looking to extract the geo-coordinates of the tweet. 我正在使用Tweepy(python)来访问Twitter搜索API,并且我希望提取推文的地理坐标。

As you can see in the screenshot, I found geo and coordinates , and they are inverted. 正如您在屏幕截图中看到的那样,我找到了geocoordinates ,并且它们被反转了。

I would like to know if I am in the good track first, then how can I distinguish between Latitude & Longitude ? 我想知道我是否先处于良好状态,然后如何区分经度和纬度?

在此处输入图片说明

If it's not in Antarctica, the -80.xxxx is longitude. 如果不在南极洲,则-80.xxxx为经度。 For longitude, the US is like ~79-80ish to ~120 something (I'm approximating). 对于经度,美国大约是79-80到120左右(我是近似值)。 It seems like the first value in 'coordinates':{} is longitude, whereas the first value in 'geo':{} is latitude. 似乎'coordinates':{}中的第一个值是经度,而'geo':{}中的第一个值是纬度。

" coordinates " is the official field for this info while the " geo " field is deprecated. 不推荐使用“ geos ”字段,而此字段的官方字段为“ 坐标 ”。 So ignore the geo field. 因此,请忽略地理字段。 For further details see this discussion http://bit.ly/1sM62oH 有关更多详细信息,请参见以下讨论:http://bit.ly/1sM62oH

You would need four data points for a bounding box that can be found from OpenStreetMap. 您可能需要四个数据点才能在OpenStreetMap中找到边界框。 For example the coordinates for Madison is as follows: 例如,麦迪逊的坐标如下:

twitterStream.filter(locations=[-89.566389,42.998071,-89.246452,43.171916]) #Madison, WI

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM