Filter by Place




Alright, so after reading through this: 80% reduction in tweets with coordinate data it’s clear that the Place object is now super important.

Currently, I’m filtering the Streaming API based on a bounding box. Will this bounding box also get tweets that have a Place internally to that bounding box, or will it only get tweets based on whether the coordinates from the user falls in the bounding box? Or, will it return tweets that have both/either a Place or user coordinates in the bounding box I have as a Location parameter?


Good question! There is a lack of formal documentation on all the location and place information, in my view. I know that the bounding box streaming API works based on any intersection overlap of your box with the user’s location, which I think refers to the ‘Place’ that is assigned to that tweet, which I think is only from the user tagging it, but possibly Twitter sometimes do this too when it has not been assigned? e.g if tweet contains Paris as a word then it would get assigned Paris in absence of anything more. It would be great to have Twitter dev confirm or deny of this supposition?

Namely: > The streaming API uses the following heuristic to determine whether a given Tweet falls within a bounding box:

If the coordinates field is populated, the values there will be tested against the bounding box. Note that this field uses geoJSON order (longitude, latitude).
If coordinates is empty but place is populated, the region defined in place is checked for intersection against the locations bounding box. Any overlap will match.
If none of the rules listed above match, the Tweet does not match the location query. Note that the geo field is deprecated, and ignored by the streaming API.


The key point there is that if a user has tagged a Place in the status, then the intersection is checked. We don’t ever geotag (via bounding box or coordinate) without a user’s permission / explicit action to choose to tag the Tweet, so no, a Place will never be assigned unless a user chooses it. Note that it is also in the developer policy that applications must not apply geo data to a Tweet without a user’s awareness.

I’m unable to share any further information about the heuristic around this.


@andypiper [quote=“andypiper, post:3, topic:41204”]
it is also in the developer policy that applications must not apply geo data to a Tweet without a user’s awareness

I thought this is exactly what GNIP’s geo enrichment does?


Not exactly. Gnip’s Geo enrichment uses signals from the user’s bio etc to attempt to infer potential location and serves that up alongside the Tweet object, not as part of the Tweet object. The Tweet object remains unchanged. The Profile Geo enrichment does contain coordinates but these are specific to the user’s biolocation that are normalised, and not it an way tied to the specific Tweet object nor the location of the user when they sent the Tweet in question.

I hope that helps a little? If you would like to learn more, there’s information on Profile Geo enrichment on the Gnip support pages.