-
Notifications
You must be signed in to change notification settings - Fork 2
Filtering Tweets by Location
nhadizad edited this page Feb 21, 2018
·
3 revisions
Based on the findings of our class it was determined that filtering tweets by location when using the standard streaming process was not very accurate. A large number of tweets fell outside the bounding box defined for the filter.
Most groups used the geo field to determine the location of the tweet. According to Twitter, this field has been deprecated, and going forward the coordinates should be used. Additionally the documentation indicates that the streaming API uses a heuristic approach to determine if the tweet falls within the bounding box.
- If the coordinates field is populated, the values there will be tested against the bounding box.
- 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.
In order to exclude place matches or only include places which fall completely within the bounding box, the code will have to perform an additional filtering step after reading the filtered stream.