org.opengts.geocoder.tinygeocoder
Class TinyGeocoder

java.lang.Object
  extended by org.opengts.geocoder.ReverseGeocodeProviderAdapter
      extended by org.opengts.geocoder.tinygeocoder.TinyGeocoder
All Implemented Interfaces:
GeocodeProvider, ReverseGeocodeProvider

public class TinyGeocoder
extends ReverseGeocodeProviderAdapter
implements ReverseGeocodeProvider, GeocodeProvider


Field Summary
protected static java.lang.String ENCODING_UTF8
           
protected static java.lang.String HOST_PRIMARY
           
protected static int TIMEOUT_Geocode
           
protected static int TIMEOUT_ReverseGeocode
           
 
Fields inherited from class org.opengts.geocoder.ReverseGeocodeProviderAdapter
_PROP_isEnabled, PROP_alwaysFast, PROP_ReverseGeocodeProvider_
 
Constructor Summary
TinyGeocoder(java.lang.String name, java.lang.String key, RTProperties rtProps)
          Constructor
 
Method Summary
 GeoPoint getGeocode(java.lang.String address, java.lang.String country)
          Returns GeoPoint of specified address
protected  int getGeocodeTimeout()
          Returns the Geocode timeout
 ReverseGeocode getReverseGeocode(GeoPoint gp, java.lang.String localStr)
          Returns a ReverseGeocode instance for the specified GeoPoint
protected  int getReverseGeocodeTimeout()
          Returns the ReverseGeocode timeout
 boolean isFastOperation()
          Returns true if locally resolved, false otherwise.
static void main(java.lang.String[] argv)
          Main entery point for debugging/testing
 
Methods inherited from class org.opengts.geocoder.ReverseGeocodeProviderAdapter
_getUserPass, _main, getAuthorization, getName, getPassword, getProperties, getUsername, isEnabled, setAuthorization, setName, setProperties, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.opengts.geocoder.ReverseGeocodeProvider
getName, isEnabled
 
Methods inherited from interface org.opengts.geocoder.GeocodeProvider
getName, isEnabled
 

Field Detail

HOST_PRIMARY

protected static java.lang.String HOST_PRIMARY

TIMEOUT_ReverseGeocode

protected static final int TIMEOUT_ReverseGeocode
See Also:
Constant Field Values

TIMEOUT_Geocode

protected static final int TIMEOUT_Geocode
See Also:
Constant Field Values

ENCODING_UTF8

protected static final java.lang.String ENCODING_UTF8
See Also:
Constant Field Values
Constructor Detail

TinyGeocoder

public TinyGeocoder(java.lang.String name,
                    java.lang.String key,
                    RTProperties rtProps)
Constructor

Parameters:
name - The name assigned to this ReverseGeocodeProvider
key - The optional authorization key
rtProps - The properties associated with this ReverseGeocodeProvider
Method Detail

isFastOperation

public boolean isFastOperation()
Returns true if locally resolved, false otherwise. (ie. remote address resolution takes more than 20ms to complete)

Specified by:
isFastOperation in interface GeocodeProvider
Specified by:
isFastOperation in interface ReverseGeocodeProvider
Overrides:
isFastOperation in class ReverseGeocodeProviderAdapter
Returns:
true if locally resolved, false otherwise.

getReverseGeocodeTimeout

protected int getReverseGeocodeTimeout()
Returns the ReverseGeocode timeout


getReverseGeocode

public ReverseGeocode getReverseGeocode(GeoPoint gp,
                                        java.lang.String localStr)
Returns a ReverseGeocode instance for the specified GeoPoint

Specified by:
getReverseGeocode in interface ReverseGeocodeProvider
Specified by:
getReverseGeocode in class ReverseGeocodeProviderAdapter
Parameters:
gp - The GeoPoint
Returns:
The ReverseGeocode instance

getGeocodeTimeout

protected int getGeocodeTimeout()
Returns the Geocode timeout


getGeocode

public GeoPoint getGeocode(java.lang.String address,
                           java.lang.String country)
Description copied from interface: GeocodeProvider
Returns GeoPoint of specified address

Specified by:
getGeocode in interface GeocodeProvider

main

public static void main(java.lang.String[] argv)
Main entery point for debugging/testing