|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.opengts.geocoder.ReverseGeocodeProviderAdapter org.opengts.geocoder.geonames.GeoNames
public class GeoNames
Field Summary | |
---|---|
protected static java.lang.String |
ATTR_message
|
protected static java.lang.String |
ENCODING_UTF8
|
protected static java.lang.String |
HOST_FAILOVER
|
protected static java.lang.String |
HOST_PRIMARY
|
protected static java.lang.String |
HOST_PRIMARY2
|
protected static double |
MAX_ADDRESS_DISTANCE_KM
|
protected static java.lang.String |
PROP_addressFailover
|
protected static java.lang.String |
PROP_failoverHostName
|
protected static java.lang.String |
PROP_hostName
|
protected static java.lang.String |
PROP_placeFailover
|
protected static java.lang.String |
PROP_postalFailover
|
protected static java.lang.String |
PROP_primaryService
|
protected static java.lang.String |
PROP_radiusKM
|
protected static java.lang.String |
PROP_service_
|
protected static java.lang.String |
PROP_streetFailover
|
protected static java.lang.String |
PROP_token
|
protected static java.lang.String |
PROP_username
|
protected static java.lang.String |
SERVICE_countrySubdivision
|
protected static java.lang.String |
SERVICE_findNearbyPlaceName
|
protected static java.lang.String |
SERVICE_findNearbyPostalCodes
|
protected static java.lang.String |
SERVICE_findNearbyStreetsOSM
|
protected static java.lang.String |
SERVICE_findNearestAddress
|
protected static java.lang.String |
TAG_address
|
protected static java.lang.String |
TAG_adminCode1
|
protected static java.lang.String |
TAG_adminName1
|
protected static java.lang.String |
TAG_adminName2
|
protected static java.lang.String |
TAG_cityName
|
protected static java.lang.String |
TAG_code
|
protected static java.lang.String |
TAG_countryCode
|
protected static java.lang.String |
TAG_countryName
|
protected static java.lang.String |
TAG_countrySubdivision
|
protected static java.lang.String |
TAG_distance
|
protected static java.lang.String |
TAG_geoname
|
protected static java.lang.String |
TAG_geonames
|
protected static java.lang.String |
TAG_isTollRoad
|
protected static java.lang.String |
TAG_lat
|
protected static java.lang.String |
TAG_lng
|
protected static java.lang.String |
TAG_name
|
protected static java.lang.String |
TAG_placename
|
protected static java.lang.String |
TAG_postalcode
|
protected static java.lang.String |
TAG_postalCode
|
protected static java.lang.String |
TAG_speedCategory
|
protected static java.lang.String |
TAG_speedRestriction
|
protected static java.lang.String |
TAG_status
|
protected static java.lang.String |
TAG_street
|
protected static java.lang.String |
TAG_streetNumber
|
protected static java.lang.String |
TAG_streetSegment
|
protected static int |
TIMEOUT_Geocode
|
protected static int |
TIMEOUT_ReverseGeocode
|
Fields inherited from class org.opengts.geocoder.ReverseGeocodeProviderAdapter |
---|
_PROP_isEnabled, DEFAULT_MAX_FAILOVER_SECONDS, MIN_FAILOVER_SECONDS, PROP_alwaysFast, PROP_maxFailoverSeconds, PROP_ReverseGeocodeProvider_ |
Constructor Summary | |
---|---|
GeoNames(java.lang.String name,
java.lang.String key,
RTProperties rtProps)
Constructor |
Method Summary | |
---|---|
ReverseGeocode |
getAddressReverseGeocode(GeoPoint gp,
java.lang.String localeStr)
Returns a ReverseGeocode instance containing address information |
static java.lang.String |
getCityLocation_xml(java.lang.String city,
java.lang.String state,
java.lang.String country,
int timeoutMS)
|
static GeoPoint |
getCityLocation(java.lang.String address,
java.lang.String state,
java.lang.String country,
int timeoutMS)
|
protected static java.util.Map<java.lang.String,java.lang.String> |
GetElementValueMap(org.w3c.dom.Element elem)
|
GeoPoint |
getGeocode(java.lang.String address,
java.lang.String country)
Returns GeoPoint of specified address |
protected int |
getGeocodeTimeout()
Returns the Geocode timeout |
protected java.lang.StringBuffer |
getGeonamesURL(boolean primary,
java.lang.String service,
GeoPoint gp)
Returns the URL for the specified Geonames service |
protected java.lang.String |
getHostname(boolean primary)
Gets the hostname |
protected double |
getMaximumSearchRadius()
Returns the maximum search radius, in kilometers |
ReverseGeocode |
getNearbyStreetNameReverseGeocode(GeoPoint gp)
|
protected static java.lang.String |
GetNodeText(org.w3c.dom.Node root)
|
ReverseGeocode |
getPlaceNameReverseGeocode(GeoPoint gp)
Returns a PlaceName ReverseGeocode instance |
static java.lang.String |
getPostalCodeLocation_xml(java.lang.String postalCode,
java.lang.String country,
int timeoutMS)
|
static GeoPoint |
getPostalCodeLocation(java.lang.String postalCode,
java.lang.String country,
int timeoutMS)
|
ReverseGeocode |
getPostalReverseGeocode(GeoPoint gp)
|
ReverseGeocode |
getReverseGeocode(GeoPoint gp,
java.lang.String localeStr,
boolean cache)
Returns a ReverseGeocode instance for the specified GeoPoint |
protected int |
getReverseGeocodeTimeout()
Returns the ReverseGeocode timeout |
java.lang.String |
getSubdivision(GeoPoint gp)
Return the subdivision of the specified point (in the US, this is "US/ |
protected static org.w3c.dom.Document |
GetXMLDocument(java.lang.String url,
int timeoutMS)
Reads the XML response from the specified URL location, returning an XML Document |
boolean |
hasUsername()
Returns true if a username has been defined |
protected void |
init_countrySubdivision()
Initializes the 'countrySubdivision' XML document generator. |
protected void |
init_findNearbyPlaceName()
Initializes the 'findNearbyPlaceName' XML document generator. |
protected void |
init_findNearbyPostalCodes()
Initializes the 'findNearbyPostalCodes' XML document generator. |
protected void |
init_findNearbyStreetsOSM()
Initializes the 'findNearbyStreetsOSM' XML document generator. |
protected void |
init_findNearestAddress()
Initializes the 'findNearestAddress' XML document generator. |
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 java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.opengts.geocoder.ReverseGeocodeProvider |
---|
getFailoverReverseGeocodeProvider, getName, isEnabled, setFailoverReverseGeocodeProvider |
Methods inherited from interface org.opengts.geocoder.GeocodeProvider |
---|
getName, isEnabled |
Field Detail |
---|
protected static final java.lang.String TAG_geonames
protected static final java.lang.String TAG_geoname
protected static final java.lang.String TAG_streetSegment
protected static final java.lang.String TAG_address
protected static final java.lang.String TAG_code
protected static final java.lang.String TAG_countrySubdivision
protected static final java.lang.String TAG_street
protected static final java.lang.String TAG_streetNumber
protected static final java.lang.String TAG_lat
protected static final java.lang.String TAG_lng
protected static final java.lang.String TAG_distance
protected static final java.lang.String TAG_postalcode
protected static final java.lang.String TAG_postalCode
protected static final java.lang.String TAG_name
protected static final java.lang.String TAG_placename
protected static final java.lang.String TAG_cityName
protected static final java.lang.String TAG_adminName2
protected static final java.lang.String TAG_adminCode1
protected static final java.lang.String TAG_adminName1
protected static final java.lang.String TAG_countryCode
protected static final java.lang.String TAG_countryName
protected static final java.lang.String TAG_speedCategory
protected static final java.lang.String TAG_speedRestriction
protected static final java.lang.String TAG_isTollRoad
protected static final java.lang.String TAG_status
protected static final java.lang.String ATTR_message
protected static final java.lang.String PROP_radiusKM
protected static final java.lang.String PROP_hostName
protected static final java.lang.String PROP_failoverHostName
protected static final java.lang.String PROP_primaryService
protected static final java.lang.String PROP_addressFailover
protected static final java.lang.String PROP_postalFailover
protected static final java.lang.String PROP_streetFailover
protected static final java.lang.String PROP_placeFailover
protected static final java.lang.String PROP_username
protected static final java.lang.String PROP_token
protected static final java.lang.String PROP_service_
protected static java.lang.String HOST_PRIMARY
protected static java.lang.String HOST_PRIMARY2
protected static java.lang.String HOST_FAILOVER
protected static final java.lang.String SERVICE_findNearestAddress
protected static final java.lang.String SERVICE_findNearbyPlaceName
protected static final java.lang.String SERVICE_countrySubdivision
protected static final java.lang.String SERVICE_findNearbyPostalCodes
protected static final java.lang.String SERVICE_findNearbyStreetsOSM
protected static final int TIMEOUT_ReverseGeocode
protected static final int TIMEOUT_Geocode
protected static final double MAX_ADDRESS_DISTANCE_KM
protected static final java.lang.String ENCODING_UTF8
Constructor Detail |
---|
public GeoNames(java.lang.String name, java.lang.String key, RTProperties rtProps)
name
- The name assigned to this ReverseGeocodeProviderkey
- The optional authorization keyrtProps
- The properties associated with this ReverseGeocodeProviderMethod Detail |
---|
public static GeoPoint getPostalCodeLocation(java.lang.String postalCode, java.lang.String country, int timeoutMS)
public static java.lang.String getPostalCodeLocation_xml(java.lang.String postalCode, java.lang.String country, int timeoutMS)
public static GeoPoint getCityLocation(java.lang.String address, java.lang.String state, java.lang.String country, int timeoutMS)
public static java.lang.String getCityLocation_xml(java.lang.String city, java.lang.String state, java.lang.String country, int timeoutMS)
public boolean isFastOperation()
isFastOperation
in interface GeocodeProvider
isFastOperation
in interface ReverseGeocodeProvider
isFastOperation
in interface SubdivisionProvider
isFastOperation
in class ReverseGeocodeProviderAdapter
protected int getGeocodeTimeout()
protected int getReverseGeocodeTimeout()
public boolean hasUsername()
public ReverseGeocode getReverseGeocode(GeoPoint gp, java.lang.String localeStr, boolean cache)
getReverseGeocode
in interface ReverseGeocodeProvider
getReverseGeocode
in class ReverseGeocodeProviderAdapter
gp
- The GeoPoint
public GeoPoint getGeocode(java.lang.String address, java.lang.String country)
GeocodeProvider
getGeocode
in interface GeocodeProvider
protected java.lang.String getHostname(boolean primary)
primary
- True to return the primary host, else failover host
protected java.lang.StringBuffer getGeonamesURL(boolean primary, java.lang.String service, GeoPoint gp)
primary
- True for primary server, false for failover serverservice
- The Geonames service
protected void init_findNearbyPlaceName()
public ReverseGeocode getPlaceNameReverseGeocode(GeoPoint gp)
gp
- The GeoPoint
protected void init_findNearestAddress()
protected double getMaximumSearchRadius()
public ReverseGeocode getAddressReverseGeocode(GeoPoint gp, java.lang.String localeStr)
gp
- The GeoPoint
protected void init_findNearbyStreetsOSM()
public ReverseGeocode getNearbyStreetNameReverseGeocode(GeoPoint gp)
protected void init_findNearbyPostalCodes()
public ReverseGeocode getPostalReverseGeocode(GeoPoint gp)
protected void init_countrySubdivision()
public java.lang.String getSubdivision(GeoPoint gp)
SubdivisionProvider
getSubdivision
in interface SubdivisionProvider
protected static org.w3c.dom.Document GetXMLDocument(java.lang.String url, int timeoutMS)
url
- The Geonames URL
protected static java.util.Map<java.lang.String,java.lang.String> GetElementValueMap(org.w3c.dom.Element elem)
protected static java.lang.String GetNodeText(org.w3c.dom.Node root)
public static void main(java.lang.String[] argv)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |