public interface Preferences extends Serializable
For overriding specific preferences without impacting all others this is how the object should be initialized for interactive api
Preferences preferences = DefaultPreferencesProvider
.getInstance().getDefaultInteractivePreferences();
//will override default distance of 5 Miles to 6 Miles
preferences.setDistance(6);
preferences.setDistanceUnits(DistanceUnit.MILES);
For geocoding services:
Preferences preferences = DefaultPreferencesProvider
.getInstance().getDefaultPreferences();
//will override default corner offset of 7 Meters to 8 Feet
preferences.setCornerOffset(8);
preferences.setDistanceUnits(DistanceUnit.FEET);
Modifier and Type | Field and Description |
---|---|
static String |
GEOHASH_LEVEL
indicator for precision level of geo hash
|
static String |
H3HEX_RESOLUTION
indicator for returning h3hex resolution of a location
|
static String |
KEY_CUSTOM_DICTIONARY_USAGE
Use this key in the custom preferences to define what to do when both custom and standard
dictionaries are available in the geocoding engine.
|
static String |
PREFER_CUSTOM_DICTIONARIES
If this value is present for KEY_CUSTOM_DICTIONARY_USAGE in the custom preferences, then when
candidates are found in both standard and custom dictionaries, the candidates from the custom
dictionaries are preferred.
|
static String |
PREFER_POBOX_OVER_STREET
If this key is present in the custom preference with a value of "true" then when both a po box
and a street address are given on input, the PO Box will be used if valid.
|
static String |
PREFER_STANDARD_DICTIONARIES
If this value is present for KEY_CUSTOM_DICTIONARY_USAGE in the custom preferences, then when
candidates are found in both standard and custom dictionaries, the candidates from the standard
dictionaries are preferred.
|
static String |
RETURN_GEOHASH
indicator for returning geo hash of a location
|
static String |
RETURN_H3HEX
indicator for returning h3hex of a location
|
static String |
RETURN_PARSED_INPUT
If this key is present in the custom preference with a value of "true" then will return parsed
input address in the Response.
|
static String |
USE_CUSTOM_DICTIONARIES_ONLY
If this value is present for KEY_CUSTOM_DICTIONARY_USAGE in the custom preferences, then only
custom dictionaries will be searched during the geocode request.
|
static String |
USE_STANDARD_DICTIONARIES_ONLY
If this value is present for KEY_CUSTOM_DICTIONARY_USAGE in the custom preferences, then only
standard dictionaries will be searched during the geocode request.
|
Modifier and Type | Method and Description |
---|---|
void |
addCustomPreference(String key,
String value)
Allows a single custom key-value pair to be added to the preferences.
|
BoundingBox |
getBoundingBox() |
String |
getClientCoordSysName()
coordinate system to return points in, specified in teh "codespace:code" format.
|
Locale |
getClientLocale()
user input locale if specified.
|
String |
getClientLocaleString()
Returns an uppercase ISO 3166 2-letter code.
|
double |
getCornerOffset()
Used for interpolating the closest house number on a range.
|
DistanceUnit |
getCornerOffsetUnits()
Units for the corner offset
|
Map<String,String> |
getCustomPreferences()
The custom preferences allow input of String key-value pairs that represent custom geocoding
preferences.
|
double |
getDistance()
Defines the maximum distance to search for reverse geocode candidates.
|
DistanceUnit |
getDistanceUnits()
Units for the distance of the reverse geocode search distance defined with getDistance
|
MatchMode |
getMatchMode()
Returns the match mode
|
int |
getMaxReturnedCandidates()
Specifies the maximum number of candidates to be returned.
|
int |
getMaxReturnedRanges()
Specifies the maximum number of ranges to be returned per candidate.
|
int |
getMaxReturnedRangeUnits()
Maximum number of unit objects to be returned on a range.
|
FieldsMatching |
getMustMatchFields()
Allows you to specify what fields must match input in order for a candidate to be considered
close
|
com.mapinfo.midev.geometry.IPoint |
getPoint() |
List<String> |
getPreferredDictionaryOrder()
If a non empty list is returned, it contains the indexes of the dictionaries to be searched.
|
ReturnFieldsDescriptor |
getReturnFieldsDescriptor()
Allows you to select what parts of a candidate to return.
|
double |
getStreetOffset()
Used for interpolating the closest house number on a range.
|
DistanceUnit |
getStreetOffsetUnits()
Units for the street offset
|
boolean |
isFallbackToGeographic()
If true and an address level geocode fails to find a close candidate, wil attempt to find a
geographic centroid based on the input address.
|
boolean |
isFallbackToPostal()
If true and an address level geocode fails to find a close candidate, wil attempt to find a
postal centroid based on the input address.
|
boolean |
isReturnAllCandidateInfo()
If set to true, all available information will be returned for each candidate.
|
void |
setBoundingBox(BoundingBox boundingBox)
set the boundingBox
|
void |
setClientCoordSysName(String name)
Set coordinate system to return points in, using format "codespace:code".
|
void |
setClientLocale(Locale locale)
This method allows the user to specify their locale.
|
void |
setCornerOffset(double offset)
Used for interpolating the closest house number on a range.
|
void |
setCornerOffsetUnits(DistanceUnit units)
Units for the corner offset
|
void |
setCustomPreferences(Map<String,String> customPreferences)
Used to map of custom fields
|
void |
setDistance(double distance)
Defines the maximum distance to search for reverse geocode candidates.
|
void |
setDistanceUnits(DistanceUnit units)
Units for the distance of the reverse geocode search distance defined with setDistance
|
void |
setFallbackToGeographic(boolean bFallback)
If true and an address level geocode fails to find a close candidate, wil attempt to find a
geographic centroid based on the input address.
|
void |
setFallbackToPostal(boolean bFallback)
If true and an address level geocode fails to find a close candidate, wil attempt to find a
postal centroid based on the input address.
|
void |
setMatchMode(MatchMode mode)
sets the match mode
|
void |
setMaxReturnedCandidates(int max)
Specifies the maximum number of candidates to be returned.
|
void |
setMaxReturnedRanges(int count)
Specifies the maximum number of ranges to be returned per candidate.
|
void |
setMaxReturnedRangeUnits(int count)
Set maximum number of unit objects to be returned on a range.
|
void |
setMustMatchFields(FieldsMatching mustMatchFields)
Allows you to specify what fields must match input in order for a candidate to be considered
close
|
void |
setPoint(com.mapinfo.midev.geometry.IPoint origin)
set the origin point
|
void |
setPreferredDictionaryOrder(List<String> orderedList)
For countries with more than one configured dictionary, this method allows the user to define
the priorities of the dictionaries and also exclude specific configured dictionaries from the
search.
|
void |
setReturnAllCandidateInfo(boolean bAll)
If set to true, all available information will be returned for each candidate.
|
void |
setReturnFieldsDescriptor(ReturnFieldsDescriptor descriptor)
Allows you to select what parts of a candidate to return.
|
void |
setStreetOffset(double offset)
Used for interpolating the closest house number on a range.
|
void |
setStreetOffsetUnits(DistanceUnit units)
Units for the street offset
|
static final String KEY_CUSTOM_DICTIONARY_USAGE
static final String PREFER_CUSTOM_DICTIONARIES
static final String PREFER_STANDARD_DICTIONARIES
static final String USE_CUSTOM_DICTIONARIES_ONLY
static final String USE_STANDARD_DICTIONARIES_ONLY
static final String RETURN_PARSED_INPUT
static final String PREFER_POBOX_OVER_STREET
static final String RETURN_GEOHASH
static final String GEOHASH_LEVEL
static final String RETURN_H3HEX
static final String H3HEX_RESOLUTION
Locale getClientLocale()
void setClientLocale(Locale locale)
locale
- the localeString getClientCoordSysName()
void setClientCoordSysName(String name)
name
- requested coordinate systemint getMaxReturnedRangeUnits()
void setMaxReturnedRangeUnits(int count)
count
- maximum units to returndouble getDistance()
void setDistance(double distance)
distance
- The radius to search for a reverse geocode address.double getStreetOffset()
void setStreetOffset(double offset)
offset
- The street offset used to interpolate house numbers.double getCornerOffset()
void setCornerOffset(double offset)
offset
- The corner offset used to interpolate house numbers.DistanceUnit getDistanceUnits()
void setDistanceUnits(DistanceUnit units)
units
- units for the reverse geocode search distanceDistanceUnit getStreetOffsetUnits()
void setStreetOffsetUnits(DistanceUnit units)
units
- units for the street offsetDistanceUnit getCornerOffsetUnits()
void setCornerOffsetUnits(DistanceUnit units)
units
- units for the corner offsetboolean isReturnAllCandidateInfo()
void setReturnAllCandidateInfo(boolean bAll)
bAll
- true to return all available information on a candidateReturnFieldsDescriptor getReturnFieldsDescriptor()
void setReturnFieldsDescriptor(ReturnFieldsDescriptor descriptor)
descriptor
- return fields objectList<String> getPreferredDictionaryOrder()
void setPreferredDictionaryOrder(List<String> orderedList)
orderedList
- list containing strings indexes describing order and dictionaries to be
searchedMap<String,String> getCustomPreferences()
void setCustomPreferences(Map<String,String> customPreferences)
customPreferences
- map of custom fieldsvoid addCustomPreference(String key, String value)
key
- this preference must be defined and understood by the target geocodervalue
- the value to be inputint getMaxReturnedRanges()
void setMaxReturnedRanges(int count)
count
- number of ranges to returnboolean isFallbackToGeographic()
void setFallbackToGeographic(boolean bFallback)
bFallback
- true to turn fallback onboolean isFallbackToPostal()
void setFallbackToPostal(boolean bFallback)
bFallback
- true to turn fallback onint getMaxReturnedCandidates()
void setMaxReturnedCandidates(int max)
max
- number of candidates to returnFieldsMatching getMustMatchFields()
void setMustMatchFields(FieldsMatching mustMatchFields)
mustMatchFields
- fields to matchMatchMode getMatchMode()
void setMatchMode(MatchMode mode)
mode
- mode to setString getClientLocaleString()
BoundingBox getBoundingBox()
void setBoundingBox(BoundingBox boundingBox)
boundingBox
- - boundary to constrain sugguested resultscom.mapinfo.midev.geometry.IPoint getPoint()
void setPoint(com.mapinfo.midev.geometry.IPoint origin)
origin
- - Origin point used for constraining suggested resultsCopyright © 2024. All rights reserved.