<spatialanalystJobs_uri>/query[.<format>]
The resource root directory of single object query. Gets the list of the single object query job of current system through sending GET request to query . Through the POST request, you can create a analysis task.
The root directory of the single object query job resource. By sending a GET request to query, you can get the list of the single object query jobs of the current system. By sending a POST request, you can create a query 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/spatialanalyst/query.rjson
Gets the job list of single object query jobs.
After executing a GET request on the resource, the response entity is a set of single object query 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 detail information of task configuration. |
By executing a GET request on this resource, the returned response result in rjosn format is as follows:
[{
"id": "cae72c2d_3550_4996_8bb1_682bc7d36533",
"setting": {
"DEFAULT_MASTER_ADRESS": "local[*] ",
"analyst": {
"datasetQuery": "Line",
"inputQuery": "F:\\20170527_bsp.jar\\test\\data_toIserver.udb",
"mode": "CONTAIN",
"numSlices": "20"
},
"appName": "query",
"args": [
"--inputSource",
"F:\\20170527_bsp.jar\\test\\data_toIserver.udb",
"--datasetSource",
"Region",
"--numSlices",
"20",
"--inputQuery",
"F:\\20170527_bsp.jar\\test\\data_toIserver.udb",
"--datasetQuery",
"Line",
"--mode",
"CONTAIN",
"--outputResult",
"F:\\20170621\\supermap_iserver_win64_zip\\webapps\\iserver\\processingResultData\\Analyst\\udbs\\586d0266-1a29-43c9-9775-9f4436fcaa5e",
"--datasetResult",
"analystResult"
],
"contextSetting": null,
"input": {
"datasetSource": "Region",
"inputSource": "F:\\20170527_bsp.jar\\test\\data_toIserver.udb"
},
"mainClass": "com.supermap.bsp.main.SpatialQueryGeoMain",
"output": {
"cacheName": null,
"cacheType": null,
"datasetResult": "analystResult",
"outputResult": "F:\\20170621\\supermap_iserver_win64_zip\\webapps\\iserver\\processingResultData\\Analyst\\udbs\\586d0266-1a29-43c9-9775-9f4436fcaa5e"
},
"serviceInfo": {
"targetDataPath": "F:\\20170621\\supermap_iserver_win64_zip\\webapps\\iserver\\processingResultData\\Analyst\\cae72c2d_3550_4996_8bb1_682bc7d36533",
"targetServiceInfos": [
{
"serviceAddress": "http://localhost:8090/iserver/services/data-spatialQueryGeo4/rest",
"serviceType": "RESTDATA"
},
{
"serviceAddress": "http://localhost:8090/iserver/services/map-spatialQueryGeo4/rest",
"serviceType": "RESTMAP"
}
]
},
"serviceRoot": "http://localhost:8090/iserver/services/"
},
"state": {
"elapsedTime": 6096,
"endState": true,
"endTime": 1498026621517,
"errorMsg": null,
"errorStackTrace": null,
"publisherelapsedTime": 2273,
"runState": "FINISHED",
"startTime": 1498026611242
}
}]
Creates a single object query job.
Parameters passed in the request body should contain:
Name | Type | Description |
input | FileCSVInputDataSetting DatasetInputDataSetting |
[Required] 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, index file stored in hdfs. For detailed parameters' description, see: Big data analysis input parameter settings. |
analyst | SpatialQueryGeoAnalystSetting |
[Required] Analysis settings. You need to specify:
|
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 output parameter settings. |
Execute a POST request on query resource to create a single object query job: http://supermapiserver:8090/iserver/services/distributedanalyst/rest/v1/jobs/spatialanalyst/query.rjson with the following request body inputs registered dataset name:
{
"input":{
"datasetName":"test_data_toIserver_Region"
},
"analyst":{
"datasetQuery":"test_data_toIserver_Line",
"mode":"CONTAIN",
}
}
then the returned resource in rjson format is as follows:
{
"newResourceID": "b604dfb0_fa16_44ff_b79f_426638ce34ca",
"newResourceLocation":"http://supermapiserver:8090/iserver/services/distributedanalyst/rest/v1/jobs/spatialanalyst/query/b604dfb0_fa16_44ff_b79f_426638ce34ca",
"postResultType": "CreateChild",
"succeed": true
}
Execute a POST request on query resource to create a single object query job: http://supermapiserver:8090/iserver/services/distributedanalyst/rest/v1/jobs/spatialanalyst/query.rjson with the following request body which specifies data stored in PostgreSQL database:
{
"input": {
"datasetInfo": {
"type": "REGION",
"name": "newyorkZone_R_1359289148",
"dataSourceName": "supermap_pg",
"datasourceConnectionInfo": {
"engineType": "POSTGRESQL",
"dataBase": "supermap",
"password": "supermap",
"user": "postgres",
"server": "192.168.112.100"
}
}
},
"analyst": {
"inputQuery":"{\"type\":\"pg\",\"info\":[{\"server\":\"192.168.120.49\",\"datasetNames\":[\"singleRegion_R_1359289148\"],\"database\":\"supermap4\",\"user\":\"postgres\",\"password\":\"supermap\"}]}",
"mode": "CONTAIN"
}
}
then the returned resource in rjson format is as follows:
{
"newResourceID": "7b106d77_eb46_4b82_93c7_c0367824123f",
"newResourceLocation":"http://supermapiserver:8090/iserver/services/distributedanalyst/rest/v1/jobs/spatialanalyst/query/7b106d77_eb46_4b82_93c7_c0367824123f",
"postResultType": "CreateChild",
"succeed": true
}
Execute a POST request on query resource to create a single object query job: http://supermapiserver:8090/iserver/services/distributedanalyst/rest/v1/jobs/spatialanalyst/query.rjson with the following request body which contains a geometry and its buffer as the query dataset:
{
"input": {
"datasetName": "samples_processing_newyorkZone_R"
},
"analyst": {
"geometryQuery": "{\"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": "CONTAIN"
}
}
then the returned resource in rjson format is as follows:
{
"newResourceID": "c5a6ee10_36ea_4431_9251_21d7a71eb80b",
"newResourceLocation":"http://supermapiserver:8090/iserver/services/distributedanalyst/rest/v1/jobs/spatialanalyst/query/c5a6ee10_36ea_4431_9251_21d7a71eb80b",
"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 query 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 query resource supports the <format> representation.