Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Understanding Twitter Streaming API geo information

Tags:

twitter

On streaming API results there are three location responses; coordinates,place and geo.

I am assuming that if tweet is sent by e.g. iphone then coordinates are there. If it's sent from web, twitter doesn't know the exact coordinates, so it gives a Place bounding box.

I couldn't understand the difference between top level geo & coordinates fields, they appear to be the same thing, but sometimes those values are different then each other. Sometimes order is different sometimes values.

I couldn't find a documentation on this, could u tell me what is the difference between them ? and is my assumption correct on bounding box?

Thanks, Devrim

[coordinates] => Array (
    [type] => Point
    [coordinates] => Array (
        [0] => -87.9
        [1] => 42.95
    )
)
[place] => Array (
    [bounding_box] => Array (
        [type] => Polygon
        [coordinates] => Array (
            [0] => Array (
                [0] => Array (
                    [0] => -87.925183
                    [1] => 42.922616
                )
                [1] => Array (
                    [0] => -87.882582
                    [1] => 42.922616
                )
                [2] => Array (
                    [0] => -87.882582
                    [1] => 42.961715
                )
                [3] => Array (
                    [0] => -87.925183
                    [1] => 42.961715
                )
            )
        )
    )
[geo] => Array (
    [type] => Point
    [coordinates] => Array (
        [0] => 42.95
        [1] => -87.9
    )
)
like image 776
Devrim Avatar asked Jun 27 '10 19:06

Devrim


People also ask

Does Twitter use geolocation?

If you are using Twitter for Android or Twitter for iOS, the Tweet may also include your precise location (i.e., the GPS coordinates from which you Tweeted), which can be found through the Twitter API, in addition to the location label you select.

How do you find a geo location on Twitter?

Twitter won't show any location information unless you've opted in to the feature, and have allowed your device or browser to transmit your coordinates to us. If you have chosen to attach location information to your Tweets, your selected location label is displayed underneath the text of the Tweet.

What is geotagged Twitter data?

Tweets can be associated with a location, generating a Tweet that has been 'geo-tagged. ' Tweet locations can be assigned by using the Twitter user-interface or when posting a Tweet using the API.


1 Answers

From my understanding, these are side effects from different parts of the API. The 'geo' part is from the original geo-tagging functionality, which has been around for quite some time.

The 'place' stuff is from the quite recent place functionality, which is designed to allow user locations to be tied back to an actual place (ie: "San Francisco", "Jim's Cafe, North Beach"), rather than just a lat/lon. See here for the original announcement:

http://groups.google.com/group/twitter-api-announce/browse_thread/thread/e7fc06e4a8cb7150

A lot of this functionality is still quite new (and overlaps somewhat with the very new annotations feature) so how you use it will somewhat depend on your app and what it does.

Cheers!

Fenn.

like image 86
fenn Avatar answered Sep 22 '22 08:09

fenn