Are country codes based on the geo information or some other source?


#1

For tweets, is the field ‘twitter.place.country_code’ based on the ‘twitter.geo.longitude’ and ‘twitter.geo.latiitude’ fields? In specific if I perform a query based on a geo bounding box around a country and the country code am I just asking for effectively the same thing or is there a way that one of these fields exists without the other or could offer different information.

Thanks,
Patrick


#2

The twitter.place.* field is based on Twitter's Places data. This is an example of Twitter's Geo data for a Starbucks in Boston, MA - http://api.twitter.com/1/geo/id/af487e8773d98d9d.json. This can be found in the twitter.place.url field. 

The twitter.geo fields are the coordinates of the exact place from where you checked in to this place. Someone may check in to a place just before they arrive, so the Tweet's coordinates may not exactly match up to the place's coordinates.

There are cases where only one of the twitter.place.* or the twitter.geo objects exists. I believe this is occurs if a Twitter Place has not yet had its coordinates set, or if you Tweet from a location not yet registered as a Twitter place. This is perhaps something that could be answered in more detail by Twitter.

To ensure you capture 100% of location enabled Tweets from a certain country, you will need to use both the bounding box and the country code. In most cases you will simply be asking for the same thing by filtering on the two fields, but there are some cases where this method will improve the quality of your results.