Use of Distributed Analyst Service through iServer REST API.

Feedback


At present, the iServer distributed analyst service has supported drawing operation, spatial analysis operation, etc. All features provide a REST API that can be implemented by executing the POST requests to create processing tasks. System administrators can also access processing Jobs in iServer via Resources page to create a spatial analysis job to publish a GIS service. The following describes how to create a space processing task through the REST API resource page and how to build a REST request.

Note: Only users with the default ADMIN role can create distributed analysis jobs. If users from other roles want to access and use the service, please refer to the security configuration of the distributed analytics service.

  1. Create a space processing task through a REST API resource page

To create an analysis task, follow these steps:

  1. After the distributed analyst service is enabled successfully, enter the iServer service resource page, such as http://supermapiserver:8090/iserver/services.
  2. Enter the "distributed analyst/rest" service resource, and click to enter the "jobs" and "spatialanalyst" resource pages in turn. At present, the spatial analysis job supports density analysis, point aggregation analysis, single object overlay analysis, and other functions. According to your needs, click to go to the resource page of the spatial analysis you need to perform.
  3. Click "Create Analysis Task" in the upper right corner.
  4. Fill in the space analysis task configuration in turn. Information marked with "*" is required.
  5. When complete, click Create Analysis Task. The page will automatically jump to the task being executed and display the configuration information. After the task is executed, the automatically published service address will also be displayed.

For an introduction to the REST API, refer to processingJobs .

  1. Build the REST request

When requesting resource creation space processing tasks through REST API, multiple data formats can be supported for input and output, as follows:

Input: 【The following parameters are required unless otherwise specified】 supports the following two input methods:

  1. datasetName:These include: Data imported through the data directory service, data registered to iServer, and datasets stored in iServer DataStore.
  1. Enter data set information. Use this method when entering the data set file path and information. Support the input of the following four file formats:
    1. CSV file: When importing a CSV data source, you must specify a file path. There should be a .meta file corresponding to the csv file under this path, and then the distributed analyst service can be performed.
      • filePath: The path where CSV is located. For example, "filePath":"E:\iserver\\ProcessingData\\newyork_taxi_2013-01_14k.csv"
    2. UDB file:
  1. spatial database

  1. Index file stored in HDFS

Output: 【optional parameter】 output of analysis results. The following output formats are supported:

  1. Local udb file. Default output. The default path is: 【SuperMap iServer install directory】/webapps/iserver/processingResultData/Analyst/{id}
    • outputPath: output path of analysis result workspace. Supports relative paths, with 【SuperMap iServer installation directory】/webapps as the relative directory
    • datasourcePath: Storage path of the result data source. Supports relative paths, with 【SuperMap iServer Installation directory】/webapps as the relative directory
    • type: Specify as udb
  1. Database (now supports PostgreSQL, PostGIS, MongoDB)