summaryRegion


URI

<spatialanalystJobs_uri>/summaryRegion[.<format>]

Supported methods

GET, POST, HEAD

Parent resource

spatialanalystJobs

Child resources

summaryRegionJob

Introduction

The root directory of the summary region analysis job resource. By sending a GET request to summaryRegion, you can get the list of the summary region analysis jobs of the current system. By sending a POST request, you can create a analysis task.

Supported Methods:

Supported output formats: RJSON, JSON, HTML, XML.

Resource hierarchy

HTTP request methods

Execute HTTP request on the following URI, here we take rjosn as the output format as an example. Where, supermapiserver is the server name.

http://supermapiserver:8090/iserver/services/distributedanalyst/rest/v1/jobs/spatialanalyst/summaryregion.rjson

GET request

Gets the list of summary region analysis jobs.

Response structure

After executing a GET request on the resource, the response entity is a set of summary region resource descriptions, and the response fields of single resource are as follows:

Field Type Description
id String Application ID.
state Jobstate The status of the task. Including execution status, start time, time consuming, and so on.
setting SparkJobSetting Lists the detailed information of task configuration.

Response example

The returned rjson format representation after implementing the GET request on the summaryRegion resourcehttp://supermapiserver:8090iserver/services/distributedanalyst/rest/v1/jobs/spatialanalyst/summaryregion.rjson is as follows:

[{

  "id": "48508e0b_d4b5_4278_bbde_9e092fe85618",

  "setting": {

    "DEFAULT_MASTER_ADRESS": "local[*] ",

    "analyst": {

      "query": "-74.050,40.650,-73.850,40.850",

      "fieldResultName": "Sum_LocationIDStandard",

      "standardFields": "LocationID",

      "resolution": "10",

      "meshSizeUnit": "Meter",

      "meshType": "0",

      "standardSummaryFields": "true",

      "standardStatisticModes": "Sum",

      "sumShape": "true",

      "weightedSummaryFields": "false"

    },

    "appName": "summaryWithinMesh",

    "args": [

      "--input",

      "{\"sliceNum\":20,\"type\":\"udb\",\"info\":[{\"server\":\"E:\\\\data\\\\test\\\\processing.udb\",\"datasetNames\":[\"singleRegion_R\"]}]}",

      "--meshType",

      "square",

      "--resolution",

      "10",

      "--sumShape",

      "true",

      "--query",

      "-74.050,40.650,-73.850,40.850",

      "--meshSizeUnit",

      "Meter",

      "--standardSummaryFields",

      "[LocationID,Sum,Sum_LocationIDStandard]",

      "--output",

      "{\"server\":\"F:\\\\iserver-code\\\\iserver\\\\etc\\\\iserver-debug\\\\src\\\\test\\\\resources\\\\iserver\\\\processingResultData\\\\Analyst\\\\udbs\\\\14ec67de-c7a5-42e0-9fae-0b9f65b7bf38\",\"datasetName\":\"analystResult\",\"type\":\"udb\"}"

    ],

    "contextSetting": null,

    "input": {

      "datasetInfo": {

        "available": true,

        "bounds": "Left=-74.0012189965531,Bottom=40.691422739248694,Right=-73.84588071508979,Top=40.84578668020041",

        "datasetName": "singleRegion_R",

        "datasetType": "REGION",

        "epsgCode": 4326,

        "name": "test_processing_singleRegion_R",

        "readOnly": false,

        "type": "UDB",

        "url": "E:\\data\\test\\processing.udb"

      },

      "datasetName": "test_processing_singleRegion_R",

      "numSlices": 0

    },

    "mainClass": "com.supermap.bsp.main.SummaryWithinMeshMain",

    "output": {

      "datasetName": "analystResult",

      "outputPath": "F:\\iserver-code\\iserver\\etc\\iserver-debug\\src\\test\\resources\\iserver\\processingResultData\\Analyst\\udbs\\14ec67de-c7a5-42e0-9fae-0b9f65b7bf38"

    },

    "serviceInfo": {

      "targetDataPath": "F:\\iserver-code\\iserver\\etc\\iserver-debug\\src\\test\\resources\\iserver\\processingResultData\\Analyst\\48508e0b_d4b5_4278_bbde_9e092fe85618",

      "targetServiceInfos": [

        {

          "serviceAddress": "http://supermapiserver:8090/iserver/services/data-summaryRegion73/rest",

          "serviceType": "RESTDATA"

        },

        {

          "serviceAddress": "http://supermapiserver:8090/iserver/services/map-summaryRegion64/rest",

          "serviceType": "RESTMAP"

        }

      ]

    },

    "serviceRoot": "http://supermapiserver:8090/iserver/services/",

    "type": "SUMMARYMESH"

  },

  "state": {

    "elapsedTime": 48120,

    "endState": true,

    "endTime": 1499671184678,

    "errorMsg": null,

    "errorStackTrace": null,

    "publisherelapsedTime": 4970,

    "runState": "FINISHED",

    "startTime": 1499671126724

  }

}]

POST request

Creates a summary region analysis job.

Request parameter

Parameters passed in the request body should contain:

Name Type Description
input FileCSVInputDataSetting
DatasetInputDataSetting
[The following parameters are required if not specified]
supporting the following input ways:

  1.  datasetName: dataset name. Used when the data to be analyzed in the Data Catalog Service is line/region type, including data imported through Data Catalog Service, registered data in iServer and datasets stored in DataStore.

2. Input file path and the related information. When the data to be analyzed does not belong to Data Catalog Service, you need use this method.
     

Supported file formats: csv file, udb file, pg database. For detailed parameters' description, see: Big data analysis input parameter settings.

analyst SummaryWithinRegionAnalysetSetting
SummaryWithinMeshAnalystSetting
[The following parameters are required if not specified]
Analysis settings. You need to specify:
    • Public field
      • sumShape: whether to calculate the sum of the area or length of the features. Optional. Defaults to true.
      • query: analysis extent. Optional. Defaults to full extent of the input dataset.
      • standardSummaryFields: whether to calculate with the standard attribute field. Optional.
      • standardFields: the name of the standard attribute field. Only supports non-system field whose type is integer, long integer or float. Required when standardSummaryFields is true
      • standardStatisticModes: standard statistic mode. Required when standardSummaryFields is true
      • weightedSummaryFields: whether to calculate with the weighted attribute field. Optional.
      • weightedFields: the name of the weighted attribute field. Required when weightedSummaryFields is true
      • weightedStatisticModes: weighted statistic mode. Only supports non-system field whose type is integer, long integer or float. Required when weightedSummaryFields is true
      • numericPrecison: Used to set the precison of the number displayed in the result label. Defaults to 1.
    • Grid regional summary
      • meshType: Grid summary type. 0 for quadrilateral summary, and 1 for hexagon summary
      • resolution: grid size. Optional
      • meshSizeUnit: grid size unit. Optional
    • Polygon regional summary
      • query: analysis extent. Optional
      • regionDataset: summary dataset
type SummaryAnalystType [Required] Summary type, includes:
    • SUMMARYMESH: Grid regional summary
    • SUMMARYREGION: Polygon regional summary
output FileSystemOutputSetting DatabaseOutputSetting

[Optional] The output of analysis result. Supported output formats: local udb file, database (pg, mongodb). For detailed parameter settings, see: Big data analysis input parameter settings.

Example 1: Input a registered dataset name as the input dataset

Execute a POST request on summaryRegion resource to create a summary region analysis job: http://supermapiserver:8090/iserver/services/distributedanalyst/rest/v1/jobs/spatialanalyst/summaryregion.rjson with the following request body which contains a registered dataset name as the input parameter:

{

    "input": {

        "datasetName": "smtiles_processing_newyorkZone_R"

    },

    "analyst": {

        "sumShape": true,

        "query": "-74.050,40.650,-73.850,40.850",

        "mappingParameters": {

            "numericPrecision": 2

        },

        "standardSummaryFields": true,

        "standardFields": "LocationID",

        "standardStatisticModes": "sum",

        "weightedSummaryFields": false,

        "meshType": "0",

        "resolution": "1000",

        "meshSizeUnit": "Meter"

    },

    "type": "SUMMARYMESH"

}

then the returned resource in rjson format is as follows:

{

  "newResourceID": "73b47027_b492_465d_b452_e88e40b1f503",

  "newResourceLocation":"http://supermapiserver:8090/iserver/services/distributedanalyst/rest/v1/jobs/spatialanalyst/summaryregion/73b47027_b492_465d_b452_e88e40b1f503",

  "postResultType": "CreateChild",

  "succeed": true

}

Example 2: Input data stored in PostgreSQL

Execute a POST request on summaryRegion resource to create a summary region analysis job: http://supermapiserver:8090/iserver/services/distributedanalyst/rest/v1/jobs/spatialanalyst/summaryregion.rjson with the following request body which contains a piece of data stored in PostgreSQL database as the input parameter:

 {

    "input": {

        "datasetInfo": {

            "type": "REGION",

            "name": "newyorkZone_R_1359289148",

            "datasourceConnectionInfo": {

                "engineType": "POSTGRESQL",

                "dataBase": "supermap4",

                "password": "supermap",

                "user": "postgres",

                "server": "192.168.120.49"

            }

        }

    },

    "analyst":{

           "regionDatasource":"{\"type\":\"pg\",\"info\":[{\"server\":\"192.168.120.49\",\"datasetNames\":[\"singleRegion_R_1359289148\"],\"database\":\"supermap4\",\"user\":\"postgres\",\"password\":\"supermap\"}]}",

           "sumShape":"true",

           "standardSummaryFields":"true",

           "weightedSummaryFields":"false",

           "standardFields":"LocationID",

           "standardStatisticModes":"sum",

           "query":"-74.050,40.650,-73.850,40.850"

         },

     "type":"SUMMARYREGION"

}

then the returned resource in rjson format is as follows:

{

  "newResourceID": "ca6464b6_63b3_419f_b3f7_4707827455e3",

  "newResourceLocation": "http://supermapiserver:8090/iserver/services/distributedanalyst/rest/v1/jobs/spatialanalyst/vectorclip/ca6464b6_63b3_419f_b3f7_4707827455e3",

  "postResultType": "CreateChild",

  "succeed": true

}

HEAD request

Returns the same HTTP response header as the GET request, but no response entity, which can be used to retrieve the meta data contained in response message header without having to transmit the entire response content. Meta data information includes media type, character coding, compression coding, entity content length, etc.

HEAD request is used to determine whether the summaryRegion resource exists, or if the user has the authority to access it. By executing an HEAD request with a .<format> URI, you can quickly determine whether the summaryRegion resource supports the <format> representation.

See