vectorClip


URI

<spatialanalystJobs_uri>/vectorclip[.<format>]

Supported methods

GET, POST, HEAD

Parent resource

spatialanalystJobs

Child resources

vectorClipJob

Introduction

The root directory of the vector clip job resource. By sending a GET request to vectorClip, you can get the list of the vector clip jobs of the current system. By sending a POST request, you can create a vector clip 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/vectorClip.rjson

GET request

Gets the list of vector clip jobs.

Response structure

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

Field Type Description
id String Application ID.
state SparkJobState 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": "a4d3f1c0_bd7e_4c3d_a63e_b02f76a293a9",

  "setting": {

    "DEFAULT_MASTER_ADRESS": "local[*] ",

    "analyst": {

      "datasetOverlay": "New_Region",

      "inputOverlay": "F:\\20170608\\onere\\onere.udb",

      "mode": "clip",

      "numSlices": "20"

    },

    "appName": "vectorClip",

    "args": [

      "--inputSource",

      "F:\\20170608\\onere\\onere.udb",

      "--datasetSource",

      "zone",

      "--numSlices",

      "20",

      "--inputOverlay",

      "F:\\20170608\\onere\\onere.udb",

      "--datasetOverlay",

      "New_Region",

      "--mode",

      "clip",

      "--outputResult",

      "F:\\20170608\\supermap_iserver_900_15008_4414_win64_zip\\webapps\\iserver\\processingResultData\\Analyst\\udbs\\fdae17ca-782b-4729-83d0-bfefb573377d",

      "--datasetResult",

      "analystResult"

    ],

    "contextSetting": null,

    "input": {

      "datasetSource": "zone",

      "inputSource": "F:\\20170608\\onere\\onere.udb"

    },

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

    "output": {

      "cacheName": null,

      "cacheType": null,

      "datasetResult": "analystResult",

      "outputResult": "F:\\20170608\\supermap_iserver_900_15008_4414_win64_zip\\webapps\\iserver\\processingResultData\\Analyst\\udbs\\fdae17ca-782b-4729-83d0-bfefb573377d"

    },

    "serviceInfo": {

      "targetDataPath": "F:\\20170608\\supermap_iserver_900_15008_4414_win64_zip\\webapps\\iserver\\processingResultData\\Analyst\\a4d3f1c0_bd7e_4c3d_a63e_b02f76a293a9",

      "targetServiceInfos": [

        {

          "serviceAddress": "http://localhost:8090/iserver/services/map-vectorClip2/rest",

          "serviceType": "RESTMAP"

        },

        {

          "serviceAddress": "http://localhost:8090/iserver/services/data-vectorClip2/rest",

          "serviceType": "RESTDATA"

        }

      ]

    },

    "serviceRoot": "http://localhost:8090/iserver/services/"

  },

  "state": {

    "elapsedTime": 12091,

    "endState": true,

    "endTime": 1496911750621,

    "errorMsg": null,

    "errorStackTrace": null,

    "publisherelapsedTime": 2804,

    "runState": "FINISHED",

    "startTime": 1496911733481

  }

}]

POST request

Creates a vector clip job.

Request parameter

Parameters passed in the request body should contain:

Name Type Definition

input

[Required]

DatasetInputDataSetting
  • Dataset input settings, used when the input data to be used is stored in Data Catalog Service. The settings should contain:
    • datasetName: The name of the dataset, which can be data imported through Data Catalog Service, the dataset corresponding to the data registered into iServer and the datasets stored in DataStore.
  • Dataset info input settings, used when inputting the dataset file path and the related infos. The settings should contain:
 FileCSVInputDataSetting
  • File path input settings, used when inputting a dataset file path. The settings should contain:
    • filePath: File path, including: csv file path and hdfs file path. For detailed parameters' description, see: Big data analysis input parameter settings.
    • metaInfo: Meta info of the data file. No need to set when the .meta file is included in the current data storage directory.

analyst

OverlayAnalystGeoAnalystSetting [Required] Analysis settings. You need to specify:
  • clip dataset (Only supports polygon dataset, index files stored in hdfs are not currently supported)
    • datasetVectorClip: If the clip dataset has been already registered in iServer, you need to specify the name of the clip dataset by this parameter, ie., OverlayAnalystGeoAnalystSetting.datasetVectorClip. Since the vector clip operation only concerns one object, the first object in the dataset will be specified as the clip object by default.
    • inputVectorClip: If the clip dataset is not registered in iServer, you need to specify the datasource path and dataset name by this parameter, ie., OverlayAnalystGeoAnalystSetting.inputVectorClip. The clip object is specified with the attributeFilter parameter since the vector clip operation only concerns one object. Defaults to read from Spark driver directly.
    • geometryClip: If you want to pass in a geometry, you need to use this parameter to specify its geometry type and specific coordinates. At the same time, it supports generating buffer for the input geometry by setting these parameters through OverlayAnalystGeoAnalystSetting.buffterAnalystParameter:
      • endType: buffer endpoint type. Including: ROUND type and FLAT type.
      • leftDistance: left buffer distance.
      • rightDistance: right buffer distance.
      • semicircleLineSegment: Used to set the number of segments at the arc of the round buffer, ie., how many segments are used to simulate a semicircle. The default value is 4.
      • radiusUnit: buffer radius unit.                    
  • clip mode, the type is OverlayMode, including clip for inside clipping and intersect for outside clipping.

output

[Optional]

FileSystemOutputSetting
  • Analysis output settings, used when outputting results to a file. The settings should contain:
    • type: Used to specify the output type.
    • datasourcePath: Used to specify the path of the result datasource. The result can be stored in udb or hdfs.
    • outputPath: The output path for result workspace.
DatabaseOutputSetting
  • Analysis output settings, used when outputting results to database (HBase, PostgreSQL, PostGIS, MongoDB). The settings should contain:
RDDOutputSetting
  • Analysis output settings, used when outputting results to distributed memory. The settings should contain:
    • type: Used to specify the output type.
    • buildPyramid: Used to set whether to open the vector pyramid in distributed memory.

Example 1: Input the registered dataset name

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

{

    "input": {

        "datasetName": "samples_processing_newyorkZone_R"

    },

    "analyst": {

        "datasetVectorClip": "samples_processing_singleRegion_R",

        "mode": "clip"

    }

}

then the returned resource in rjson format is as follows:

{

  "newResourceID": "f88cd129_a989_4f6c_a8e0_4f9d225f6b54",

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

  "postResultType": "CreateChild",

  "succeed": True

}

Example 2: Input data stored in PostgreSQL

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

 {

    "input": {

        "datasetInfo": {

            "type": "REGION",

            "name": "zone",

            "datasourceConnectionInfo": {

                "engineType": "POSTGRESQL",

                "dataBase": "supermap4",

                "password": "supermap",

                "user": "postgres",

                "server": "192.168.120.49"

            }

        }

    },

"analyst":{

                  "inputVectorClip": "{\"type\":\"udb\",\"info\":[{\"server\":\"D:/data/zone.udb\",\"datasetNames\":[\"New_Region\"]}],\"attributeFilter\":\"SMID=1\"}",

                  "mode":"clip"

           }

 }

then the returned resource in rjson format is as follows:

{

  "newResourceID": "b53a553f_a099_4baf_bc30_e68c41d08cf0",

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

  "postResultType": "CreateChild",

  "succeed": True

}

Example 3: Input a geometry as the clip dataset

Execute a POST request on vectorClip resource to create a vector clip job: http://supermapiserver:8090/iserver/services/distributedanalyst/rest/v1/jobs/spatialanalyst/vectorclip.rjson with the following request body which contains a geometry and its buffer as the clip dataset:

{

    "input": {

        "datasetName": "samples_processing_newyorkZone_R"

    },

    "analyst": {

        "geometryClip": "{\"type\":\"REGION\",\"points\":[{\"x\":-73.96,\"y\":40.78},{\"x\":-73.90,\"y\":40.78},{\"x\":-73.95,\"y\":40.742},{\"x\":-73.90,\"y\":40.747}]}",

        "bufferAnalystParameter": {

            "endType": "ROUND",

            "leftDistance": {

                "value": "10"

            },

            "rightDistance": {

                "value": "10"

            },

            "semicircleLineSegment": "10",

            "radiusUnit": "METER"

        },

        "mode": "clip"

    }

}

then the returned resource in rjson format is as follows:

{

  "newResourceID": "4197351c_cfe6_43fe_83a8_e97cf1327cf3",

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

  "postResultType": "CreateChild",

  "succeed": True

}

Example 4: Output results to distributed memory

Execute a POST request on vectorClip resource to create a vector clip job: http://supermapiserver:8090/iserver/services/distributedanalyst/rest/v1/jobs/spatialanalyst/vectorclip.json with the following request body to output the result into distributed memory:

{

    "input": {

        "datasetName": "sample_processing_newyorkZone_R"

    },

    "analyst": {

        "datasetVectorClip": "sample_processing_singleRegion_R",

        "mode": "clip"

    },

    "output": {

        "type": "RDD",

        "buildPyramid": false

    }

}

then the returned operation result in rjson format is as follows:

{

  "newResourceID": "5d418de6_52d1_4c1c_acf7_0de9b145aa75",

  "newResourceLocation":"http://192.168.120.46:8090/iserver/services/distributedanalyst/rest/v1/jobs/spatialanalyst/vectorclip/5d418de6_52d1_4c1c_acf7_0de9b145aa75",

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

See