aggregatePoints


URI

<spatialanalystJobs_uri>/aggregatePoints[.<format>]

Supported methods

GET, POST, HEAD

Parent resource

spatialanalystJobs

Child resources

aggregatePointsJob

Introduction

The root directory of the points aggregation analysis job resource. By sending a GET request to aggregatePoints, you can get the list of the points aggregation 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/topologyvalidator.rjson

GET request

Gets the list of points aggregation analysis jobs.

Response structure  

After executing a GET request on the resource, the response entity is a set of points aggregation 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": "53709374_fd76_49de_815f_4ccaf3183dde",

  "setting": {

    "DEFAULT_MASTER_ADRESS": "local[*] ",

    "analyst": {

      "fields": "col7",

      "meshType": "0",

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

      "resolution": "1000",

      "resultFieldNames": "max_col7",

      "statisticModes": "max"

    },

    "appName": "summaryMesh",

    "args": [

      "--input",

      "{\"type\":\"csv\",\"info\":[{\"server\":\"F:\\\\20170707\\\\ProcessingData\\\\newyork_taxi_2013-01_14k.csv\"}]}",

      "--bounds",

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

      "--summaryFields",

      "[col7,max,max_col7]",

      "--meshType",

      "square",

      "--meshSize",

      "1000",

      "--output",

      "{\"server\":\"F:\\\\20170707\\\\supermap_iserver_win64_zip\\\\webapps\\\\iserver\\\\processingResultData\\\\Analyst\\\\udbs\\\\0ffb2eee-368c-45e1-99cd-7f4f47ea8215\",\"datasetName\":\"analystResult\",\"type\":\"udb\"}"

    ],

    "contextSetting": null,

    "input": {

      "datasetInfo": {

        "available": true,

        "firstRowIsHead": false,

        "name": "ProcessingData_newyork_taxi_2013-01_14k",

        "separator": ",",

        "type": "CSV",

        "url": "F:\\20170707\\ProcessingData\\newyork_taxi_2013-01_14k.csv",

        "zindex": 10,

        "yIndex": 11

      },

      "datasetName": "ProcessingData_newyork_taxi_2013-01_14k",

      "numSlices": 0

    },

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

    "output": {

      "datasetName": "analystResult",

      "{\"server\":\"F:\\\\20170707\\\\supermap_iserver_win64_zip\\\\webapps\\\\iserver\\\\processingResultData\\\\Analyst\\\\udbs\\\\0ffb2eee-368c-45e1-99cd-7f4f47ea8215\",\"datasetName\":\"analystResult\",\"type\":\"udb\"}"

    },

    "serviceInfo": {

      "targetDataPath": "F:\\20170707\\supermap_iserver_win64_zip\\webapps\\iserver\\processingResultData\\Analyst\\53709374_fd76_49de_815f_4ccaf3183dde",

      "targetServiceInfos": [

        {

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

          "serviceType": "RESTDATA"

        },

        {

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

          "serviceType": "RESTMAP"

        }

      ]

    },

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

    "type": "SUMMARYMESH"

  },

  "state": {

    "elapsedTime": 6096,

    "endState": true,

    "endTime": 1499398059821,

    "errorMsg": null,

    "errorStackTrace": null,

    "publisherelapsedTime": 2342,

    "runState": "FINISHED",

    "startTime": 1499398047901

  }

}

POST request

Creates a task of points aggregation 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: dataset name. Used when the data to be analyzed in the Data Catalog Service is point type, including data imported through Data Catalog Service, registered data in iServer and point 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 SummaryAnalystSetting
SummaryMeshAnalystSetting
 

[Required] Analysis settings. When passing in parameters, you need to specify parameters according to different aggregation methods:


summary region:

  • fields: weight field, optional. Only supports non-system integer, long integer, float fields. Field index starts from 0.
  • statisticModes: Statistics mode, optional, including: max, min, average, sum, variance, stdDeviation. The field should be have the same count with the count of the Weight fields.
  • region aggregation dataset:
    • regionDataset: If the dataset is registered with iServer, you need to specify it via this field.
    • regionDatasource: If the dataset is not registered, you need to specify it via this field.。
  • numericPrecision: Used to set the numeric precision displayed in the label. Default is 1.
summary mesh:
  • query: analysis extent, optional. Defaults to full extent.
  • fields: Weight field of the point to be analyzed, optional. Only supports non-system integer, long integer, float fields.
  • statisticModes: Statistics mode, optional, including: max, min, average, sum, variance, stdDeviation. The field should be have the same count with the count of the Weight fields.
  • resolution: mesh size.
  • meshSizeUnit: The unit of mesh size, optional.
  • meshType: mesh type. 0 represents quadrilateral mesh, 1 represents hexagonal mesh.
  • numericPrecision: Used to set the numeric precision displayed in the label. Default is 1.
type SummaryAnalystType [Required] points aggregation analysis type. Includes: SummaryMesh, SummaryRegion.
output FileSystemOutputSetting
DatabaseOutputSetting
[Optional] output of the analysis result. Currently supported output format: local udb file, database (pg, mongodb. For detailed parameter settings, see: Big data analysis input parameter settings.

Example 1: Input the registered dataset name and output sets to custom local udb file

Execute a POST request on aggregatePoints resource to create a points aggregation analysis job: http://supermapiserver:8090/iserver/services/distributedanalyst/rest/v1/jobs/spatialanalyst/aggregatepoints.rjson with the following request body which inputs registered dataset name and specifies a local udb file to output the result:

{

    "input": {

        "datasetName": "samples_newyork_taxi_2013-01_14k"

    },

    "analyst": {

        "fields": "",

        "statisticModes": "",

        "query": "",

        "resolution": "100",

        "meshType": "0",

        "meshSizeUnit": "Meter"

    },

    "type": "SUMMARYMESH",

    "output": {

        "outputPath": "F:\\20171018\\result\\aggregatepoints.smwu",

        "datasourcePath": "F:\\20171018\\result\\aggregatepoints.udb",

        "type": "udb"

    }

}

then the returned resource in rjson format is as follows:

{

  "newResourceID": "096ab70e_bdfb_4f83_8965_5e7f90a7a5ec",

  "newResourceLocation":"http://supermapiserver:8090/iserver/services/distributedanalyst/rest/v1/jobs/spatialanalyst/aggregatepoints/096ab70e_bdfb_4f83_8965_5e7f90a7a5ec",

  "postResultType": "CreateChild",

  "succeed": true

}

 

Example : Input unregistered dataset name and output sets to pg database

Execute a POST request on aggregatePoints resource to create a points aggregation analysis job: http://supermapiserver:8090/iserver/services/distributedanalyst/rest/v1/jobs/spatialanalyst/aggregatepoints.rjson with the following request body which inputs unregistered csv file path and specifies pg database to store the output result:

{

    "input": {

        "filePath": "F:\\20170629\\ProcessingData\\newyork_taxi_2013-01_14k.csv"

    },

    "analyst": {

        "fields": "",

        "statisticModes": "",

        "query": "",

        "resolution": "0.001",

        "meshType": "0"

    },

    "type": "SUMMARYMESH",

    "output": {

        "type": "pg",

        "outputPath": "F:\\20171018\\SUMMARYMESH.smwu",

        "datasetName": "resultany",

        "datasourceInfo": {

            "server": "192.168.120.46",

            "alias": "supermap1_pg",

            "dataBase": "supermap1",

            "user": "postgres",

            "engineType": "POSTGRESQL",

            "password": "supermap"

        }

    }

}

then the returned resource in rjson format is as follows:

{

  "newResourceID": "edab41bf_e491_4a02_b439_04ad368ebe29",

  "newResourceLocation":"http://supermapiserver:8090/iserver/services/distributedanalyst/rest/v1/jobs/spatialanalyst/aggregatepoints/edab41bf_e491_4a02_b439_04ad368ebe29",

  "postResultType": "CreateChild",

  "succeed": true

}

Example 2: Input data stored in PostgreSQL

Execute a POST request on aggregatePoints resource to create a points aggregation analysis job: http://supermapiserver:8090/iserver/services/distributedanalyst/rest/v1/jobs/spatialanalyst/aggregatepoints.rjson with the following request body which specifies data stored in PostgreSQL database:

{

    "input": {

        "datasetInfo": {

            "type": "POINT",

            "name": "newyorkPoint_P_2142356139",

            "datasourceConnectionInfo": {

                "engineType": "POSTGRESQL",

                "dataBase": "supermap",

                "password": "supermap",

                "user": "postgres",

                "server": "192.168.120.46"

            }

        }

    },

    "analyst": {

        "regionDatasource": "{\"type\":\"pg\",\"info\":[{\"server\":\"192.168.120.46\",\"datasetNames\":[\"newyorkZone_R_2142356139\"],\"database\":\"supermap\",\"user\":\"postgres\",\"password\":\"supermap\"}]}",

        "fields":"PASSENGER_COUNT",

        "statisticModes": "sum"

    },

    "type": "SUMMARYREGION"

}

then the returned resource in rjson format is as follows:

{

  "newResourceID": "0ce3a547_1e0d_43fa_908c_5410532e9e9d",

  "newResourceLocation": "http://supermapiserver:8090/iserver/services/distributedanalyst/rest/v1/jobs/spatialanalyst/aggregatepoints/0ce3a547_1e0d_43fa_908c_5410532e9e9d",

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

See