Welcome to the Harris Geospatial product documentation center. Here you will find reference guides, help documents, and product libraries.


Harris Geospatial / Docs Center / Geospatial Services Framework / GSF Tutorial: Getting Started

Geospatial Services Framework

GSF Tutorial: Getting Started

GSF - Tutorial - Getting Started

Starting the Server


Option #1: As a Command Line Application

  • Start a terminal and navigate to the installation directory.
  • Issue the following to start the server:
    node server.js
    
  • To stop the server issue Ctrl+C from the terminal where the server is running.
  • Issue the following to learn the other options available at server startup:
    node server.js -h
    

Option #2: As a Service

  • Start a terminal and navigate to the installation directory.
  • Issue the following to add the service:
      node service add
    
  • Issue the following to remove the service:
      node service remove
    
  • Additionally, you may start and stop the service using the command line with the following commands:
      node service start
    
      node service stop
    

Configuring the Server


The server comes with a default configuration file (GSFxx/config.json) which can be updated or replaced with a custom configuration file. All of the available configuration options are defined in gsf-server-core. Restart the server any time this file is changed so it reflects the new configuration.

Modules can accept additional optional configuration values in the same file mentioned above.

GSF comes with a command line utility for updating the config.json file. For example, to change the location of the workspace folder, start a command prompt in the GSFxx directory and execute the following command:

node updateConfig.js config.json --set workspaceManager.root=new/folder/location

This will set the root property of the workspaceManager configuration object to new/folder/location. The updateConfig.js script will automatically back up the original config.json file for you.

Alternatively, you may also manually edit the config.json file. Below is an example of changing the location of the workspace folder:

{
  ...,
  "workspaceManager":{
    "type":"gsf-basic-workspace-manager",
    "root":"new/folder/location"
  }
  ...,
}

Restart the server any time this file is changed so it reflects the new configuration.

More information on module configuration may be acquired by reading the help documentation for each module.

Configuring Multiple Workers

Simultaneous processes may be run on a single machine, or node. This method of forking processes is useful for maximizing available resources.

Option #1: Configuration File

Changing the number of workers on a single machine is simple.

To set the number of workers in the configuration file from a command line, start a command prompt in the GSFxx directory and execute the following command:

node updateConfig.js config.json --set workers=8

You may also manually update the number of workers by editing the config.json file and setting the "workers" JSON key to the desired number of workers. It is recommended that you back up your config file before making any changes manually.

{
  ...,
  "workers": 8
}

Restart the server any time this file is changed so it reflects the new configuration.

Option #2: Command Line Argument

The number of workers may also be specified using a command line argument when starting the server. This will override the "workers" value in the configuration file for this server instance.

node server.js -w 8

To take advantage of the processing capabilities of multiple nodes (machines), see Clustering.

Submit a Job


To submit a job, create a file called submitJob.js in the GSFxx directory. Add the following contents to the file:

// Submit the job
var request = require('request');
request.post(
    {
      url : 'http://localhost:9191/ese/services/ENVI/SpectralIndex/submitJob',
      json: {
        INPUT_RASTER: {
          url    : 'http://localhost:9191/ese/data/qb_boulder_msi', // This is a reference to data that ships with the server.
          factory: 'URLRaster'
        },
        INDEX       : 'Normalized Difference Vegetation Index'
      }
    },
    function(err, resp) {
      // redirects to the status page on complete, get that URL
      var statusURL = 'http://localhost:9191' + resp.headers.location;
      console.log('Status URL', statusURL);
    }
  );

To run this JavaScript code, perform the following steps:

  • Start a terminal and navigate to the folder that contains submitJob.js
  • Issue the following command:
    • node submitJob.js
  • After the job submits, the status URL prints to the console. Copy the URL to a browser to observe results.

This example assumes use of the default configuration, specifically the ese-request-handler, and that ENVI is installed.

For information on setting up a custom endpoint that serves up HTML and runs a job, see Custom Request Handler tutorial.



© 2017 Exelis Visual Information Solutions, Inc. |  Legal
My Account    |    Buy    |    Contact Us