razin kac
razin kac

Reputation: 17

Cannot to get twitter data in specific location

I try to get American tweets using Twitter4J, when I set the specific location like this code:

    FilterQuery fq = new FilterQuery();        
    double lat1 = 48.996059d;
    double long1 = -125.361695d;
    double lat2 = 29.269125d;
    double long2 = -67.683473d;
    twitterStream.addListener(listener);
    double[][] bb = {{lat1, long1}, {lat2, long2}};
    fq.locations(bb);
    twitterStream.filter(fq); 

I got error like this:

Parameter not accepted with the role. 406:Returned by the Search API when an invalid format is specified in the request. Returned by the Streaming API when one or more of the parameters are not suitable for the resource. The track parameter, for example, would throw this error if: The track keyword is too long or too short. The bounding box specified is invalid. No predicates defined for filtered resource, for example, neither track nor follow parameter defined. Follow userid cannot be read. Latitude/longitude are not valid: 49.00, -125.36, 29.27, -67.68

I guess Twitter4J cannot read minus(-) coordinate, because when I set without minus, it works.

Thank you for any reply

Upvotes: 0

Views: 73

Answers (1)

razin kac
razin kac

Reputation: 17

I solve it by self. It must SW first

Upvotes: 0

Related Questions