buffers


URI

<spatialanalystJobs_urii>/buffers[.<format>]

Supported methods

GET, POST, HEAD

Parent resource

spatialanalystJobs

Child resources

buffersJob

Introduction

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

GET request

Gets the list of buffer analysis jobs.

Response structure   

After executing a GET request on the resource, the response entity is a set of overlay 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": "8e57bf84_bb5d_4167_9e86_d9c533790d06",

    "setting": {

        "DEFAULT_MASTER_ADRESS": "local[*] ",

        "analyst": {

            "bounds": "",

            "dissolveField": "LocationID",

            "distance": "100",

            "distanceField": "",

            "distanceUnit": "Meter"

        },

        "appName": "CreateBuffers",

        "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\"]}]}",

            "--distance",

            "100",

            "--distanceUnit",

            "Meter",

            "--dissolveField",

            "LocationID",

            "--output",

            "{\"server\":\"192.168.120.21\",\"password\":\"supermap\",\"database\":\"supermap1\",\"datasetName\":\"analystResult_2091235435\",\"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.CreateBuffersMain",

        "output": {

            "datasetName": "analystResult_2091235435",

            "datasourceInfo": {

                "alias": "supermap1_pg",

                "connect": true,

                "dataBase": "supermap1",

                "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\\8e57bf84_bb5d_4167_9e86_d9c533790d06\\buffers.smwu",

            "type": "pg"

        },

        "serviceInfo": {

            "targetDataPath": "F:\\1.package\\20171014\\supermap_iserver_901_15413_4668_win64_zip\\webapps\\iserver\\processingResultData\\Analyst\\8e57bf84_bb5d_4167_9e86_d9c533790d06\\buffers.smwu",

            "targetServiceInfos": [

                {

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

                    "serviceType": "RESTDATA"

                },

                {

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

                    "serviceType": "RESTMAP"

                }

            ]

        },

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

        "sparkLogFile": null

    },

    "state": {

        "elapsedTime": 19023,

        "endState": true,

        "endTime": 1508206175930,

        "errorMsg": null,

        "errorStackTrace": null,

        "publisherelapsedTime": 4287,

        "runState": "FINISHED",

        "startTime": 1508206149260

    }

}

POST request

Creates a buffer 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 is 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 BuffersOverlayAnalystGeoAnalystSettingSpatialQueryGeoAnalystSetting Analysis settings. You need to specify:
  • bounds: analysis bounds, optional. Defaults to the full extent of the input dataset.
  • distance: buffer distance or buffer radius, optional. Valid when distanceField is empty. Defaults to 10.
  • distanceField: buffer distance field. When this field is enabled, the corresponding value of this field in each object will be used as the buffer distance. distance parameter is invalid at this time. Optional, only supports non-sytem numberic fields.
  • distanceUnit: unit of buffer distance. Options: Meter, Kilometer, Yard, Foot,Mile. Defaults to Meter.
  • dissolveField: dissolve field. Used to dissolve the result buffer regions based on the specified field. Optional, only supports non-system fields.
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 dataset name

Execute a POST request on buffers resource to create a buffer  analysis job: http://supermapiserver:8090/iserver/services/distributedanalyst/rest/v1/jobs/spatialanalyst/buffers .rjson with the following request body which specifies the registered dataset name:

{

    "input": {

        "datasetName": "samples_processing_newyorkZone_R"

    },

    "analyst": {

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

        "distance": "100",

        "distanceField": "distance",

        "distanceUnit": "Meter",

        "dissolveField": "LocationID"

    }

}

then the returned resource in rjson format is as follows:

{

  "newResourceID": "2448867c_c77f_4335_9e39_65fd65964fdb",

  "newResourceLocation":"http://supermapiserver:8090/iserver/services/distributedanalyst/rest/v1/jobs/spatialanalyst/buffers/2448867c_c77f_4335_9e39_65fd65964fdb",

  "postResultType": "CreateChild",

  "succeed":true

}

Example 2: Input data stored in PostgreSQL

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

{

    "input": {

        "datasetInfo": {

            "type": "REGION",

            "name": "newyorkZone_R_1522375355",

            "datasourceConnectionInfo": {

                "engineType": "POSTGRESQL",

                "dataBase": "supermap",

                "password": "supermap",

                "user": "postgres",

                "server": "192.168.120.21"

            }

        }

    },

    "analyst": {

        "bounds": "",

        "distance": "",

        "distanceField": "",

        "distanceUnit": "Meter",

        "dissolveField": "LOCATIONID"

    }

}

then the returned resource in rjson format is as follows:

{

  "newResourceID": "7b4a46ea_1a95_4524_8238_bc169b5e0df3",

  "newResourceLocation":"http://supermapiserver:8090/iserver/services/distributedanalyst/rest/v1/jobs/spatialanalyst/buffers/7b4a46ea_1a95_4524_8238_bc169b5e0df3",

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

See