<buildindex_uri>/grid[.<format>]
The directory of creating grid index job. By sending a GET request to grid, you can get the list of the creating grid index 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.
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/dataprocessing/buildindex/grid.rjson
Gets the list of creating grid index jobs of the current system.
After executing a GET request on grid resource, the response entity is a set of creating grid index 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. |
By executing a GET request on grid resource, the returned response result in rjosn format is as follows:
[{
"id": "6acafdac_f5f3_4c76_9ae5_b5a9625e69cd",
"state": {
"errorStackTrace": null,
"endState": true,
"startTime": 1513748139147,
"endTime": 1513748170478,
"publisherelapsedTime": 0,
"runState": "FINISHED",
"errorMsg": null,
"elapsedTime": 30318
},
"setting": {
"output": {
"outputPath": null,
"datasourcePath": "hdfs://192.168.112.126:9000/data/test123",
"datasetName": "analystResult",
"type": "INDEXEDHDFS"
},
"args": null,
"input": {
"datasetName": "samples_processing_newyorkZone_R",
"numSlices": 36,
"specField": null,
"datasetInfo": {
"fieldInfos": [
{
"isRequired": true,
"defaultValue": "",
"name": "SmID",
"caption": "SmID",
"type": "INT32",
"maxLength": 4,
"isZeroLengthAllowed": true,
"isSystemField": true
},
{
"isRequired": true,
"defaultValue": "0",
"name": "SmSdriW",
"caption": "SmSdriW",
"type": "SINGLE",
"maxLength": 4,
"isZeroLengthAllowed": true,
"isSystemField": true
},
{
"isRequired": true,
"defaultValue": "0",
"name": "SmSdriN",
"caption": "SmSdriN",
"type": "SINGLE",
"maxLength": 4,
"isZeroLengthAllowed": true,
"isSystemField": true
},
{
"isRequired": true,
"defaultValue": "0",
"name": "SmSdriE",
"caption": "SmSdriE",
"type": "SINGLE",
"maxLength": 4,
"isZeroLengthAllowed": true,
"isSystemField": true
},
{
"isRequired": true,
"defaultValue": "0",
"name": "SmSdriS",
"caption": "SmSdriS",
"type": "SINGLE",
"maxLength": 4,
"isZeroLengthAllowed": true,
"isSystemField": true
},
{
"isRequired": true,
"defaultValue": "0",
"name": "SmUserID",
"caption": "SmUserID",
"type": "INT32",
"maxLength": 4,
"isZeroLengthAllowed": true,
"isSystemField": false
},
{
"isRequired": true,
"defaultValue": "0",
"name": "SmArea",
"caption": "SmArea",
"type": "DOUBLE",
"maxLength": 8,
"isZeroLengthAllowed": true,
"isSystemField": true
},
{
"isRequired": true,
"defaultValue": "0",
"name": "SmPerimeter",
"caption": "SmPerimeter",
"type": "DOUBLE",
"maxLength": 8,
"isZeroLengthAllowed": true,
"isSystemField": true
},
{
"isRequired": false,
"defaultValue": "0",
"name": "SmGeometrySize",
"caption": "SmGeometrySize",
"type": "INT32",
"maxLength": 4,
"isZeroLengthAllowed": true,
"isSystemField": true
},
{
"isRequired": true,
"defaultValue": "-1",
"name": "SmGeoPosition",
"caption": "SmGeoPosition",
"type": "INT64",
"maxLength": 8,
"isZeroLengthAllowed": true,
"isSystemField": true
},
{
"isRequired": false,
"defaultValue": "",
"name": "OBJECTID",
"caption": "OBJECTID",
"type": "INT32",
"maxLength": 4,
"isZeroLengthAllowed": true,
"isSystemField": false
},
{
"isRequired": false,
"defaultValue": "",
"name": "Shape_Leng",
"caption": "Shape_Leng",
"type": "DOUBLE",
"maxLength": 8,
"isZeroLengthAllowed": true,
"isSystemField": false
},
{
"isRequired": false,
"defaultValue": "",
"name": "Shape_Area",
"caption": "Shape_Area",
"type": "DOUBLE",
"maxLength": 8,
"isZeroLengthAllowed": true,
"isSystemField": false
},
{
"isRequired": false,
"defaultValue": "",
"name": "zone",
"caption": "zone",
"type": "WTEXT",
"maxLength": 254,
"isZeroLengthAllowed": true,
"isSystemField": false
},
{
"isRequired": false,
"defaultValue": "",
"name": "LocationID",
"caption": "LocationID",
"type": "INT32",
"maxLength": 4,
"isZeroLengthAllowed": true,
"isSystemField": false
},
{
"isRequired": false,
"defaultValue": "",
"name": "borough",
"caption": "borough",
"type": "WTEXT",
"maxLength": 254,
"isZeroLengthAllowed": true,
"isSystemField": false
}
],
"epsgCode": 4326,
"datasetName": "newyorkZone_R",
"bounds": "Left=-74.25551784310493,Bottom=40.496084221255856,Right=-73.70014827248451,Top=40.91538866049913",
"available": true,
"name": "samples_processing_newyorkZone_R",
"readOnly": false,
"datasetType": "REGION",
"type": "UDB",
"url": "../../samples/data/ProcessingData/processing.udb"
}
},
"DEFAULT_MASTER_ADRESS": "local[*] ",
"referToken": "dZWm9aJqJbEYKkVEZyc8qKPdVK0oVIh9p-UzDxZTEFUH_o9rEPcqAKl7s-tfkS4euGyUAm6jUbA5S1JWpaeuiQ..",
"mainClass": null,
"sparkLogFile": null,
"appName": null,
"analyst": {
"bounds": "-74.050,40.650,-73.850,40.850",
"indexFile": "",
"interval": "0",
"isSer": true,
"rows": "10",
"cols": "10"
},
"contextSetting": null,
"serviceInfo": {
"targetDataPath": null,
"targetServiceInfos": null
},
"referServicesAddress": "http://supermapiserver:8090/iserver"
}
}]
Creates a data directory of hdfs with a grid spatial index.
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, only supports point, line and polygon: 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 | BuildGridIndexAnalystSetting | [Required] Analysis settings.
|
output | FileSystemOutputSetting |
[Optional] The output of analysis result. Only supports outputting to hdfs directory. Note: Only supports newly created hdfs directory, existing hdfs directories are not supported. |
Execute a POST request on grid resource to create a data processing job: http://supermapiserver:8090/iserver/services/distributedanalyst/rest/v1/jobs/dataprocessing/buildindex/grid .rjson by configuring parameters:
{
"input": {
"datasetName": "samples_processing_newyorkZone_R"
},
"analyst": {
"indexFile": "",
"bounds": "-74.050,40.650,-73.850,40.850",
"rows": "10",
"cols": "10",
"interval": "0"
},
"output": {
"datasourcePath": "hdfs://192.168.112.126:9000/data/test1",
"type": "INDEXEDHDFS"
}
}
then the returned resource in rjson format is as follows:
{
"newResourceID": "6acafdac_f5f3_4c76_9ae5_b5a9625e69cd",
"newResourceLocation":"http://localhost:8090/iserver/services/distributedanalyst/rest/v1/jobs/dataprocessing/buildindex/grid/6acafdac_f5f3_4c76_9ae5_b5a9625e69cd",
"postResultType": "CreateChild",
"succeed": true
}
Execute a POST request on grid resource to create a data processing job: http://supermapiserver:8090/iserver/services/distributedanalyst/rest/v1/jobs/dataprocessing/buildindex/grid .rjson by specifying existing index file:
{
"input": {
"datasetName": "samples_processing_newyorkZone_R"
},
"analyst": {
"indexFile": "hdfs://192.168.112.126:9000/data/test1",
"bounds": "-74.050,40.650,-73.850,40.850",
"rows": "",
"cols": "",
"interval": ""
},
"output": {
"datasourcePath": "hdfs://192.168.112.126:9000/data/test",
"type": "INDEXEDHDFS"
}
}
then the returned resource in rjson format is as follows:
{
"newResourceID": "0799bf7b_6010_4c12_bbf3_647152d53e7b",
"newResourceLocation": "http://supermapiserver:8090/iserver/services/distributedanalyst/rest/v1/jobs/spatialanalyst/overlay/0799bf7b_6010_4c12_bbf3_647152d53e7b",
"postResultType": "CreateChild",
"succeed": true
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 grid 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 grid resource supports the <format> representation.