amiref
amiref

Reputation: 3431

Coordinates field in Tweet objects

In every tweet object there are two fields related to location, (i) place and (ii) coordinates. Whenever I tweet something and switch on the location, only the place filed gets value. I'm wondering in what conditions the coordinates field is filled.

Upvotes: 1

Views: 1136

Answers (2)

Ellie K
Ellie K

Reputation: 903

Summary: The root level “geo” and “coordinates” attributes provide the decimal degree coordinates for the exact location. Tweets containing this metadata can also include “Twitter Place” data, although the presence of both is not guaranteed. Important to note! The “coordinates” attribute is formatted as [LONGITUDE, latitude], while the “geo” attribute is formatted as [latitude, LONGITUDE].

According to Twitter Developers help about geo objects, place object is always filled when a tweet is geo-tagged.

The coordinates object is only filled (i.e. non-null) if the tweet is assigned an exact location. If an exact location is provided by the user, then the coordinates object is populated with [longitude, latitude]. In other words, a list of candidate Twitter Places is presented to users after the user decides to assign a location to their tweet, and the coordinates of that Twitter Place appear in the tweet.

There are three metadata sources for geo-referencing tweets:

  1. Tweet location: tweets that are geotagged with an exact location or Twitter Place.

    • Exact location with long/lat coordinates: -85.7629, 38.2267
    • Twitter Place with a name (“Louisville Central”) and four pairs of lat/long coordinates that define a “bounding box.”
  2. Mentioned location: parsing the Tweet message for geospatial location.

    • “If you are in Louisville, check out the pizza place off main”
    • “I’m in Louisville and it is raining cats and dogs”
  3. Profile location: parsing the account-level location for locations of interest.

    • “I live in Louisville, home of the Derby!”
    • “I live in Louisville, the one in beautiful Colorado.”

For example JSON that illustrates how this metadata is delivered in the Tweet payload, along with details on how to filter on it, see this gnip article.

Upvotes: 4

amiref
amiref

Reputation: 3431

I asked the same question in the Twitter developer forum, and got the following response:

coordinates is populated when an app adds a precise lat/lon location to a Tweet. This feature was removed in our own apps a few months ago, although users can still use a place in the Tweet Composer. Third party apps that use the API might still use the exact location and thus the coordinates value may be populated. In general, a smaller proportion of Tweets will now have coordinates included that was true in the past.

https://twittercommunity.com/t/coordinates-field-in-tweet-objects/130372

Upvotes: 4

Related Questions