Filtered Stream Match Any with only Location

Jun 23, 2015 at 12:30 PM
Hi,

I've created a filtered stream that only has a location. I've then started the stream using StartStreamMatchingAnyCondition method. However, I am getting tweets found that do not match the location. Here is the code I use to start the stream:
var filteredStream = FilteredStreamFactory.Create();

foreach (var term in terms)
{
    filteredStream.AddTrack(term);
}

foreach (var user in users)
{
    var userId = UserFactory.GetUserFromScreenName(user).Id;
    filteredStream.AddFollow(userId);
}

if (geocode != null)
{
    var bounds = new Bounds(geocode.Latitude, geocode.Longitude, geocode.Radius);

    var southWest = new Coordinates(bounds.WestLongitude, bounds.SouthLatitude);
    var northEast = new Coordinates(bounds.EastLongitude, bounds.NorthLatitude);
    var location = new Location(southWest, northEast);

    filteredStream.AddLocation(location);
}

filteredStream.StartStreamMatchingAnyCondition();
Here is the debug window just before the stream is started. As you can see it has no tracks, no follows and one location. And yet it pulls in tweets that have no location information at all. Is this correct behaviour? I would think that using the StartStreamMatchingAnyCondition method in this way would require the tweet to have a location in order to be found.

Image
Coordinator
Jun 23, 2015 at 6:14 PM
Hi,

Are you saying that you receive tweets that you should not receive or that there are missing information in the ITweet that you receive?

I think there might be some missing information in the ITweet bouding box properties but I don't think Tweetinvi will ever return a Tweet that is not matching your coordinates.

Cheers,
Linvi
Jun 24, 2015 at 11:59 AM
Hi linvi,

The tweets I receive have no coordinate information at all.

If I use StartStreamMatchingAllConditions and use the same filtered stream (i.e. a stream with only a single location set) then the stream only brings in tweets when I tweet from my office. However, if I use StartStreamMatchingAnyCondition then a whole load of tweets are brought in, none of which have coordinates.
Coordinator
Jun 24, 2015 at 2:29 PM
Hi,

Thank you for the clarification. I think I have a better understanding of the issue. Just to make sure we are on the same page I am reformulating it.
If you think I am not correct please let me know.
You create a FilteredStream with a single filter on location (let's call it 'TheCity').
When you start the stream with MatchingAllConditions, you only receive tweets from 'TheCity' and all these tweets have coordinate information. This is the expected behavior.
When you start the stream with MatchingAnyConditions you receive tweets from 'TheCity' as well as other unexpected tweets that do not contain coordinates information. This is the bug.
A work item has been created : https://tweetinvi.codeplex.com/workitem/2606.
Please vote on it if you want to receive notifications concerning this issue.

I am going to have a look into your problem.
I will also let you know in this discussion when the issue is resolved.

Kind Regards,
Linvi
Jun 24, 2015 at 3:04 PM
Hi linvi,

Yes that is a correct summation of the issue I am experiencing.
Coordinator
Jun 25, 2015 at 4:32 PM
Hi there,

As you might have seen through the issue notification that I have added a fix. Here is a bit of explanation on the issue.

There was an issue when a tweet did not have specific gps coordinates but instead a bounding box of coordinates. Tweetinvi was only using the exact coordinates to match the tracked location. This has been fixed with the new code I checked in yesterday.

But in addition to this issue of Tweetinvi, Twitter is returning some tweets that are not located in the location you entered. I therefore created a post on the twitter forum to inform the developers of the Twitter stream API and get some answers from them.

I will keep you up to date as soon as I have some news from the Twitter Team.
Cheers,
Linvi
Coordinator
Jun 27, 2015 at 2:31 PM
Edited Jun 27, 2015 at 2:32 PM
Hi,

The fix is now available in Tweetinvi 0.9.8.1.

I am still waiting for a response from Twiter concerning out of the coordinates tweets returned by the stream.

Regards,
Linvi