summaryAttributes


URI

<spatialanalystJobs_uri>/summaryAttributes[.<format>]

 

Supported methods

GET, POST, HEAD

Parent resource

spatialanalystJobs

Child resources

summaryAttributesJob

Introduction

The root directory of the summary attributes analysis job resource. By sending a GET request to summaryAttributes, you can get the list of the summary attributes 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/summaryattributes.rjson

GET request

Gets the list of summary attributes analysis jobs.

Response structure  

After executing a GET request on the resource, the response entity is a set of summaryAttributes 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

By executing a GET request on this resource, the returned response result in rjosn format is as follows:

{

  "id": "b999e6ba_61c7_4c29_9009_5d876469db33",

  "setting": {

    "DEFAULT_MASTER_ADRESS": "local[*] ",

    "analyst": {

      "attributeField": "",

      "groupField": "",

      "resultField": null,

      "statisticModes": ""

    },

    "appName": "SummaryAttributes",

    "args": [

      "--input",

      "{\"sliceNum\":20,\"type\":\"udb\",\"info\":[{\"server\":\"F:\\\\1.package\\\\20171014\\\\supermap_iserver_901_15413_4668_win64_zip\\\\samples\\\\data\\\\ProcessingData\\\\processing.udb\",\"datasetNames\":[\"newyorkZone_R\"]}]}",

      "--output",

      "{\"server\":\"192.168.120.21\",\"password\":\"supermap\",\"database\":\"supermap2\",\"datasetName\":\"analystResult_1698682527\",\"blockingWrite\":null,\"type\":\"pg\",\"user\":\"postgres\"}"

    ],

    "contextSetting": null,

    "input": {

      "datasetInfo": {

        "available": true,

        "bounds": "Left=-74.25551784310493,Bottom=40.496084221255856,Right=-73.70014827248451,Top=40.91538866049913",

        "datasetName": "newyorkZone_R",

        "datasetType": "REGION",

        "epsgCode": 4326,

        "name": "samples_processing_newyorkZone_R",

        "readOnly": false,

        "type": "UDB",

        "url": "../../samples/data/ProcessingData/processing.udb"

      },

      "datasetName": "samples_processing_newyorkZone_R",

      "numSlices": 0

    },

    "mainClass": "com.supermap.bdt.main.SummaryAttributesMain",

    "output": {

      "datasetName": "analystResult_1698682527",

      "datasourceInfo": {

        "alias": "supermap2_pg",

        "connect": true,

        "dataBase": "supermap2",

        "driver": "PostgreSQL ANSI",

        "engineType": "POSTGRESQL",

        "exclusive": false,

        "openLinkTable": false,

        "password": "supermap",

        "readOnly": false,

        "server": "192.168.120.21",

        "user": "postgres"

      },

      "outputPath": "F:\\1.package\\20171014\\supermap_iserver_901_15413_4668_win64_zip\\webapps\\iserver\\processingResultData\\Analyst\\b999e6ba_61c7_4c29_9009_5d876469db33\\summaryAttributes.smwu",

      "type": "pg"

    },

    "serviceInfo": {

      "targetDataPath": "F:\\1.package\\20171014\\supermap_iserver_901_15413_4668_win64_zip\\webapps\\iserver\\processingResultData\\Analyst\\b999e6ba_61c7_4c29_9009_5d876469db33\\summaryAttributes.smwu",

      "targetServiceInfos": [{

        "serviceAddress": "http://192.168.120.21:8090/iserver/services/data-summaryAttributes/rest",

        "serviceType": "RESTDATA"

      }]

    },

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

    "sparkLogFile": null

  },

  "state": {

    "elapsedTime": 6177,

    "endState": true,

    "endTime": 1508224183579,

    "errorMsg": null,

    "errorStackTrace": null,

    "publisherelapsedTime": 1823,

    "runState": "FINISHED",

    "startTime": 1508224172840

  }

}

POST request

Creates a summary attributes 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] Supports two input ways:

 1.  datasetName: datasetName: dataset name. Used when the data to be analyzed is the dataset provided by the Data Catalog Service, 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 SummaryAttributesAnalystSetting [Optional] Analysis settings. You need to specify:
  • groupField: The grouping field, used to group objects, the objects of the same attribute value are divided in to a group and then calculate the statistics by each group. Supports to set multi-field with "," to seperate each other. If the group field is not set, the statistics will be calculated on all the objects. Only supports non-system fields.
  • attributeField: The attribute field, used to calculate the statistics according to this attribute. Supports to set multi-field with "," to seperate each other, and the length of multiple fields need to be consistent with the statisticModes. If attributeField is not set, no statistics will be calculated. If the groupField is empty, all objects in the attribute table are considered as a group, and the statistics is based on this big group. Only supports non-system numeric fields.
  • statisticModes: Supports to set multi-field with "," to seperate each other, and the length of multiple fields need to be consistent with the attributeField. Supported mode: max,min,average,sum,variance,stdDeviation.
  • If all the above fields are empty, the statistics will be calculated based on all the objects in the attribute table.
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 summaryAttributes resource to create a summary attributes analysis job: http://supermapiserver:8090/iserver/services/distributedanalyst/rest/v1/jobs/spatialanalyst/summaryattributes.rjson with the following request body which contains a registered dataset name as the input parameter:

{

    "input": {

        "datasetName": "samples_processing_newyorkZone_R"

    },

    "analyst": {

        "groupField": "borough",

        "attributeField": "LocationID",

        "statisticModes": "max"

    }

}

then the returned resource in rjson format is as follows:

{

  "newResourceID": "740e3864_4698_4cf2_aa2a_3e25282bcac7",

  "newResourceLocation":"http://supermapiserver:8090/iserver/services/distributedanalyst/rest/v1/jobs/spatialanalyst/summaryattributes/740e3864_4698_4cf2_aa2a_3e25282bcac7",

  "postResultType": "CreateChild",

  "succeed": true

}

Example 2: Input data stored in PostgreSQL as the input dataset

Execute a POST request on summaryAttributes resource to create a summary attribute analysis job: http://supermapiserver:8090/iserver/services/distributedanalyst/rest/v1/jobs/spatialanalyst/summaryattributes.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_657101200",

            "datasourceConnectionInfo": {

                "engineType": "POSTGRESQL",

                "dataBase": "supermap",

                "password": "supermap",

                "user": "postgres",

                "server": "192.168.120.21"

            }

        }

    },

    "analyst": {

        "groupField": "borough",

        "attributeField": "LocationID",

        "statisticModes": "min"

    }

}

then the returned resource in rjson format is as follows:

{

  "newResourceID": "6bb40d00_e89b_493d_b787_e0e82fd4fc57",

  "newResourceLocation":  "http://supermapiserver:8090/iserver/services/distributedanalyst/rest/v1/jobs/spatialanalyst/summaryattributes/6bb40d00_e89b_493d_b787_e0e82fd4fc57",

  "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 summaryAttributes 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 summaryAttributes resource supports the <format> representation.

See