twitter4j.api
Interface GeoMethods

All Known Implementing Classes:
Twitter

public interface GeoMethods

Since:
Twitter4J 2.1.1
Author:
Yusuke Yamamoto - yusuke at mac.com

Method Summary
 Place getGeoDetails(java.lang.String id)
          Find out more details of a place that was returned from the GeoMethodsAsync.reverseGeoCode(twitter4j.GeoQuery) method.
 ResponseList<Place> getNearbyPlaces(GeoQuery query)
          Deprecated. Issue 1754
 ResponseList<Place> reverseGeoCode(GeoQuery query)
          Search for places (cities and neighborhoods) that can be attached to a statuses/update.
 

Method Detail

getNearbyPlaces

ResponseList<Place> getNearbyPlaces(GeoQuery query)
                                    throws TwitterException
Deprecated. Issue 1754

Search for places (cities and neighborhoods) that can be attached to a statuses/update. Given a latitude and a longitude pair, or an IP address, return a list of all the valid cities and neighborhoods that can be used as a place_id when updating a status. Conceptually, a query can be made from the user's location, retrieve a list of places, have the user validate the location he or she is at, and then send the ID of this location up with a call to statuses/update.
This method calls http://api.twitter.com/1/geo/nearby_places.json

Parameters:
query - search query
Returns:
places (cities and neighborhoods) that can be attached to a statuses/update
Throws:
TwitterException - when Twitter service or network is unavailable
Since:
Twitter4J 2.1.1
See Also:
Twitter API Wiki / Twitter REST API Method: GET geo nearby_places

reverseGeoCode

ResponseList<Place> reverseGeoCode(GeoQuery query)
                                   throws TwitterException
Search for places (cities and neighborhoods) that can be attached to a statuses/update. Given a latitude and a longitude, return a list of all the valid places that can be used as a place_id when updating a status. Conceptually, a query can be made from the user's location, retrieve a list of places, have the user validate the location he or she is at, and then send the ID of this location up with a call to statuses/update.
There are multiple granularities of places that can be returned -- "neighborhoods", "cities", etc. At this time, only United States data is available through this method.
This API call is meant to be an informative call and will deliver generalized results about geography.
This method calls http://api.twitter.com/1/geo/reverse_geocode.json

Parameters:
query - search query
Returns:
places (cities and neighborhoods) that can be attached to a statuses/update
Throws:
TwitterException - when Twitter service or network is unavailable
Since:
Twitter4J 2.1.1
See Also:
GET geo/reverse_geocode | dev.twitter.com

getGeoDetails

Place getGeoDetails(java.lang.String id)
                    throws TwitterException
Find out more details of a place that was returned from the GeoMethodsAsync.reverseGeoCode(twitter4j.GeoQuery) method.
This method calls http://api.twitter.com/1/geo/id/:id.json

Parameters:
id - The ID of the location to query about.
Returns:
details of the specified place
Throws:
TwitterException - when Twitter service or network is unavailable
Since:
Twitter4J 2.1.1
See Also:
GET geo/id/:place_id | dev.twitter.com