de.monarchy.guideme.routing
Interface GeoCodingComponent

All Known Implementing Classes:
AndroidGeoCoding, NutiteqGeoCoding, OSMGeoCoding

public interface GeoCodingComponent

Simple interface for using external geocoding services. A class implementing this interface can either be providing data synchronously or asynchronously. It is not required to implement both ways, in that case, a UnsupportedOperationException is thrown.

Author:
dstuerze

Field Summary
static int ERROR_NOT_FOUND
          Error message indicating a result could not be obtained
static int ERROR_SERVICE_DOWN
          Error message indicating the geocoding service is not responding
static int EVERYWHERE
          searches for this address without bounds
 
Method Summary
 void findNear(GeoCodingListener l, java.lang.String search, GeoCoordinate location, int maxDistance)
          Searches places defined by a search string in an area around a certain location.
 PointOfInterest[] findNear(java.lang.String search, GeoCoordinate location, int maxDistance)
          Searches places defined by a search string in an area around a certain location.
 

Field Detail

EVERYWHERE

static final int EVERYWHERE
searches for this address without bounds

See Also:
Constant Field Values

ERROR_SERVICE_DOWN

static final int ERROR_SERVICE_DOWN
Error message indicating the geocoding service is not responding

See Also:
Constant Field Values

ERROR_NOT_FOUND

static final int ERROR_NOT_FOUND
Error message indicating a result could not be obtained

See Also:
Constant Field Values
Method Detail

findNear

PointOfInterest[] findNear(java.lang.String search,
                           GeoCoordinate location,
                           int maxDistance)
                           throws java.lang.UnsupportedOperationException
Searches places defined by a search string in an area around a certain location. The method will call a geocoding service and deliver an array of possible matches. The search is restricted to an area near a given location. The maximal distance is denoted by the parameter maxDistance, which can be set to the constant value EVERYWHERE to search without restrictions.

Parameters:
search - place that is searched
location - location near the place
maxDistance - maximum distance between location and place
Returns:
array of possible matches
Throws:
java.lang.UnsupportedOperationException - if a synchronous call is not supported

findNear

void findNear(GeoCodingListener l,
              java.lang.String search,
              GeoCoordinate location,
              int maxDistance)
              throws java.lang.UnsupportedOperationException
Searches places defined by a search string in an area around a certain location. The method will call a geocoding service and deliver an array of possible matches. The search is restricted to an area near a given location. The maximal distance is denoted by the parameter maxDistance, which can be set to the constant value EVERYWHERE to search without restrictions. After the call is completed, the given listener receives an answer.

Parameters:
l - RoutingListener the result is delivered to
search - place that is searched
location - location near the place
maxDistance - maximum distance between location and place
Throws:
java.lang.UnsupportedOperationException - if an asynchronous call is not supported