Getting Started with the REST API

Requirements

  • Java 8
  • GGS distribution (ggs-dist-{version}.zip)
    • Once unzipped, you'll need the GGS SDK CLI located in "{directory}/ggs-dist-{version}/cli"
  • Dataset(s) in the Spectrum data format (*.spd)
  • Server capable of deploying and running a .war file (i.e., Tomcat)

Placeholders

The following conventions are used as placeholders for some common items:
  • {directory} Any directory where you would like to install the resources for the SDK.
  • {version} The version of the GGS SDK such as 3.0.0.
  • {spd} Dataset in the Spectrum data format. For example, KGD082019.spd.
  • {tomcat} - installed Tomcat location. For example, apache-tomcat-8.5.30.

Configure using the GGS CLI

  1. Create a location where datasets will be installed.
    1. Windows:
      mkdir {directory}/data
    2. Linux:
      mkdir -p {directory}/data
  2. Run the GGS CLI. The command below starts the CLI in interactive mode.
    Note: The GGS CLI can be run in interactive or batch mode. [About the CLI Batch Process.]
    1. Windows:
      cd {directory}/ggs-dist-{version}/cli
      cli.cmd
    2. Linux:
      cd {directory}/ggs-dist-{version}/cli
      cli.sh
  3. Locate .spd file(s) and extract the dataset(s). [About the Extract command.]
    extract --s "{spd}" --d "{directory}/data"
  4. Configure data for the SDK, based on the dataset location, by running this command from within the interactive CLI. [About the Configure command.]
    configure --s "{directory}/data" --d "{directory}/ggs-dist-{version}/resources/config"

Deploy REST API to Tomcat

Note: The {tomcat}/webapps/Geocode directory must be empty before proceeding with this command. [About the Deploy command.]
deploy  --c  "/ggs-dist-{version}/resources"  --m  "WAR_EXTRACTED"  --d  "{tomcat}/webapps/Geocode"  --l "{tomcat}/logs"

Start the Server

  1. From the tomcat directory cd {tomcat}/bin
    1. Windows:
      startup.bat
    2. Linux:
      ./startup.sh

Sample Application

As you explore the REST services, you may find it helpful to use the Global Geocoding API Sample. This is an interactive web application that demonstrates the geocoding API. The URL is relative to any context of the server, depending on where the war is deployed. URL: http://{server}:{port}/{:context}/sample/index.html

For example, to see typeahead functionality, click the Interactive Geocode tab in the sample application.

Note: Prior to using the sample application, if you haven't completed the steps above, you must first install and configure your geocoding datasets using the GGS CLI.

Additional Information