- routing.properties - The routing properties file contains configuration parameters for the GR SDK instance.
- dbList.json - The data resource file contains the datasets and database configurations used by the GR SDK.
- For the Java API, the two configuration files can have any filename as long as they are referenced appropriately. For the instructions in this document, we are going to refer to these configuration files as routing.properties, and dbList.json.
- For the REST API, only the dbList.json configuration file can have any filename as long as it is referenced appropriately.
Routing Properties File
The routing properties file controls the routing instance default values and configuration. There are example routing.properties files (Java and REST) included with the GR SDK installation.
These can be found in the following locations:
- Java - install_dir\samples\resources
- REST - after deploying the WAR file, tomcat_install_dir>\webapps\webApp-context\WEB-INF\classes
These files can be located anywhere on the file system. When creating routing applications, these property files a defined in the GRAInstanceImpl class to pass the routing parameters. For more information see, Using Java API.
Parameter Name | Description | Required | Example |
---|---|---|---|
routeDefaultCoordSys | Specifies the default coordinate system. | No | EPSG:4326 |
routeTimeout | Specifies the amount of processing time (in milliseconds) before stopping a point to point routing request if processing is not complete. Default is 500000. | No | 750000 |
multiPointTimeout | Specifies the amount of processing time (in milliseconds) before stopping a multipoint (point to point with intermediate points) routing request if processing is not complete. Default is 500000. | No | 600000 |
matrixRouteTimeout | Specifies the amount of processing time (in milliseconds) before stopping a matrix routing request if processing is not complete. Default is 500000. | No | 750000 |
allowFallback | Specifies whether to use major roads when other roads are unavailable. This is a Boolean parameter; if set as true, the engine uses major roads when other roads cannot be used. | No | False |
shortProcessThreads | Specifies the number of threads to be used for point to point route requests and routing data requests. | No | 16 |
longProcessThreads | Specifies the number of threads to be used for isochrone, matrix route, and multi-point route requests. | No | 16 |
dynamicLoading | Specifies if the configuration changes are dynamically loaded. This is a Boolean type and if set to true, any changes in the properties and JSON configuration files will be loaded without restarting the application. Default is false. | No | False |
dbConfigJSONFile | Specifies the file object with the path of the data resource file (dbList.json). This can be the absolute path to the directory on the file system or the relative path from the properties file to the data resource file. | Yes | E:\\GRA\\resources\\dbList.json |
Data Resource File
The data resource file contains all of the data resources that are accessible to the GR SDK, and defines the names of the databases used in the API. The file can be configured with multiple datasets and you can combine these datasets into the databases used by the API. There are example dbList.json files (Java and REST) included with the GR SDK installation. These can be found in the following locations:
- Java - See install_dir\samples\resources
- REST - After deploying the WAR file, see tomcat_install_dir>\webapps\webApp-context\WEB-INF\classes
- To execute the REST API sample, refer to the readme.txt file in the Install_dir\samples directory.
- The dbList.json file inside the extracted WAR file must have a database with name DC configured with the path of the data in the install_dir\resources\datasets directory.
Parameter Name | Description | Values |
---|---|---|
defaultDatabase | Specifies the name of the default database to be used. The database must be a valid database name defined in this file. For the Java API, this database is used if the DBResource method is not set in the API. For the REST API, this database is used if the dbsource.json is set to default.json. Although this parameter is optional, it is recommended to define the default database in case one is not specified in the code. | Define the name of the database to be used as the default. This must be one of the name values defined in the databases parameter. |
datasets | Specifies the list of datasets to be made accessible to the GR SDK as databases. | Define the id element which is the unique identifier for the dataset. This is the value used to define the datasets element in the databases parameter. Define the paths element which is the location of the data on your file system.The path can be the absolute path to the directory on the file system or the relative path from the data resource file to the data. Path can also be a folder containing multiple routing datasets. In this case, each sub folder will be scanned for routing data and the routing data loaded for processing. Note: When specifying a folder, it should only contain routing data. During data loading, the Spatial server looks for the metadata.json file to locate the routing data.This file is also present for GeoCoding data. To avoid confusion (a failure during data loading) we recommend keeping only routing data under a folder. |
databases | Specifies the list of databases used by the API. You can combine datasets into a single database. | Define the name element which is the unique identifier for the database.This is also the name used to define the default database, or set the database being used in the API. Define the datasets element, which is the list of datasets that will make up the database.You can define one or more comma separated id(s) of the datasets. |
- If the DBResource method is not set in the API, the defaultDatabase parameter in the data resource file is used for calculations.
- All properties in data resource file are case sensitive.
Example data resource file, with one database (US) consisting of two datasets:
{
"defaultDatabase": "US",
"datasets": [{
"id": "US NE dataset",
"paths": ["E:\\db\\ERM_Quarterly_MAR2015\\ERM-US\\2014.09\\driving\\northeast"]
}, {
"id": "US Central dataset",
"paths": ["E:\\db\\ERM_Quarterly_MAR2015\\ERM-US\\2014.09\\driving\\central"]
}
],
"databases": [{
"name": "US",
"datasets": ["US NE dataset", "US Central dataset"]
}
]
}