Starting with Global Geocoding SDK 4.0, configuration is now in a YAML format.
The default configuration file accepted is
addressing.yaml
.It contains configuration information for data sources, geocoding, and interactive preferences.
Generate the default model using the configure command from the Geocoding CLI Utility (GGS CLI).
addressing.yaml
config:
default:
preferences: # default preferences used for geocoding
properties: # default properties used for initialization
INTERACTIVE:
preferences: # default preferences used for interactive geocoding
properties: # default properties used for initialization
USA: # overriding country specific settings
properties:
ZIP_PBKEYS: true
RETURN_EXTENDED_DATA: yes
DEBUG: no
dataSources: # supports multiple destination locations (helps with partitioned devices)
- spdDataSource: # there can be multiple spdDataSource's
spdPaths: # Each destination can have multiple source locations
- D:/data
- C:/something.spd
extractedPath: C:/extracted # Any spd data found in spdPaths will be extracted here
- fileDataSource: C:/extracted1 # fileDataSource is used for any pre-extracted data
- customDataSource: # custom data source can be registered here
# class is an implemntation of com.precisely.addressing.configuration.DataSource
# (see java docs for more)
className: com.precisely.MyCustomDataSource
options: # any options needed for DataSource implementation
key1: val1
remoteConfiguration: # configuration for remote component does not apply for Geocoding API
activateFor: # enable to run in remote component
- ggs
deactivateFor: # list of factories that should not be loaded in remote process
- global_locator
maxActive: 4 # defaults to number of CPU
maxIdle: 1 # defaults to number of CPU
minIdle: 1 # defaults to number of CPU
port: 0 # default 0, system will determine based on open port
minimumMemory: 2048 # default minimum 2048 MB or 2 GB
maximumMemory: 0 # default 0 or null means unset
vmargs: # any JVM args -Xmx and -Xms is set based on minimumMemory or maximumMemory
javaProperties: # map of java properties. provided to remote process using -D parameter
Create or modify default geocoding preferences
This applies for both Addressing API and Geocoding API
config:
default:
preferences: # default preferences used for geocoding
maxResults: 1 # maximum number of results that will be returned for request
returnAllInfo: true # return all possible content for result
# find admin level result if address is not found on street
fallbackToGeographic: true
# find postal level result if address is not found on street
fallbackToPostal: false
# coordinate system used for returning location
clientCoordSysName: "epsg:4326"
# locale to use for either input content and or returning result
clientLocale: en_US
customPreferences: # any additional preferences which are not part of top level structure
FALLBACK_TO_WORLD: true
# if return all info is false this can be used to return specific fields
returnOfAdditionalFields:
- PB_KEY
matchMode: CUSTOM # match modes that control how matching is done (more in dev guide)
factoryDescription:
# default underlying api which is used for all unless feature specific defined
label: global_locator
featureSpecific:
GEOCODE: ggs # speficially select which api is used for given feature
cornerOffset:
value: 10
distanceUnit: METER
streetOffset:
value: 10
distanceUnit: METER
distance:
value: 10
distanceUnit: METER
spdDataSource
spdDataSource
can be used for data which is available in *.spd format delivered for the Global Geocoding SDK. Multiple spdDataSource
can be defined to extract data in different locations. *.spd files can also be extracted using Geocoding CLI Utility (GGS CLI).
dataSources: # supports multiple destination locations (helps with partitioned devices)
- spdDataSource: # there can be multiple spdDataSource's
spdPaths: # Each destination can have multiple source locations
- D:/data
- C:/something.spd
extractedPath: C:/extracted # Any spd data found in spdPaths will be extracted here
- spdDataSource: # there can be multiple spdDataSource's
spdPaths: # Each destination can have multiple source locations
- D:/data1
- C:/something1.spd
extractedPath: C:/extracted1 # Any spd data found in spdPaths will be extracted here
All files available in extractedPath
locations will be scanned to find valid data sources.
fileDataSource
fileDataSource
can be used to configure already extracted data. Extraction can be done using the configure command
from the Geocoding CLI Utility (GGS CLI).
dataSources: # supports multiple destination locations (helps with partitioned devices)
- fileDataSource: C:/extracted1 # fileDataSource is used for any pre-extracted data
- fileDataSource: C:/extracted2 # fileDataSource is used for any pre-extracted data
customDataSource
A custom data source can be registered by doing a custom implementation of com.precisely.addressing.configuration.DataSource
then registering a particular data source using the method below. custom data source must be available in class path based on runtime configuration. if app is running in remote component jar must be placed in GGS runtime resources under /resources/lib/{some}.jar
dataSources:
- customDataSource: # custom data source can be registered here
# class is an implementation of com.precisely.addressing.configuration.DataSource
# (see java docs for more)
className: com.precisely.MyCustomDataSource
options: # any options needed for DataSource implementation
key1: val1
remoteConfiguration
This section is only used for Addressing API. Addressing API creates a remote component so it can safely execute native code without harming the main java process, in case a crash happens for native code.
remoteConfiguration: # configuration for remote component does not apply for Geocoding API
activateFor: # enable to run in remote compoent
- ggs
deactivateFor: # list of factories that should not be loaded in remote process
- global_locator
maxActive: 4 # defaults to number of CPU
maxIdle: 1 # defaults to number of CPU
minIdle: 1 # defaults to number of CPU
port: 0 # default 0, system will determine based on open port
minimumMemory: 2048 # default minimum 2048 MB or 2 GB
maximumMemory: 0 # default 0 or null means unset
vmargs: # any JVM args -Xmx and -Xms is set based on minimumMemory or maximumMemory
javaProperties: # map of java properties. provided to remote process using -D parameter