<spatialanalystJobs_uri>/summaryregion[.<format>]
区域汇总作业资源根目录。通过对 summaryRegion 执行GET 请求,可获取当前系统的区域汇总作业列表。通过 POST 请求可创建一个分析任务。
支持的方法:
支持的表述格式:RJSON、JSON、HTML、XML。
对如下 URI 执行 HTTP 请求,以 rjson 输出格式为例加以说明,其中,supermapiserver 是服务器名。
http://supermapiserver:8090/iserver/services/distributedanalyst/rest/v1/jobs/spatialanalyst/summaryregion.rjson
获取对区域汇总的作业列表。
对 summaryRegion 资源执行 GET 请求,在响应消息的实体主体里是一个区域汇总资源描述集,其中单个资源描述的结构如下:
字段 | 类型 | 说明 |
id | String | 应用ID。 |
state | SparkJobState | 该任务的状态。包括执行状态、起止时间、耗时等。 |
setting | SparkJobSetting | 列举了任务配置的详细信息。 |
对示例 summaryRegion 资源:http://supermapiserver:8090iserver/services/distributedanalyst/rest/v1/jobs/spatialanalyst/summaryregion.rjson 执行 GET 请求,返回 rjson 格式的资源描述如下:
[{
"id": "48508e0b_d4b5_4278_bbde_9e092fe85618",
"setting": {
"DEFAULT_MASTER_ADRESS": "local[*] ",
"analyst": {
"query": "-74.050,40.650,-73.850,40.850",
"fieldResultName": "Sum_LocationIDStandard",
"standardFields": "LocationID",
"resolution": "10",
"meshSizeUnit": "Meter",
"meshType": "0",
"standardSummaryFields": "true",
"standardStatisticModes": "Sum",
"sumShape": "true",
"weightedSummaryFields": "false"
},
"appName": "summaryWithinMesh",
"args": [
"--input",
"{\"sliceNum\":20,\"type\":\"udb\",\"info\":[{\"server\":\"E:\\\\data\\\\test\\\\processing.udb\",\"datasetNames\":[\"singleRegion_R\"]}]}",
"--meshType",
"square",
"--resolution",
"10",
"--sumShape",
"true",
"--query",
"-74.050,40.650,-73.850,40.850",
"--meshSizeUnit",
"Meter",
"--standardSummaryFields",
"[LocationID,Sum,Sum_LocationIDStandard]",
"--output",
"{\"server\":\"F:\\\\iserver-code\\\\iserver\\\\etc\\\\iserver-debug\\\\src\\\\test\\\\resources\\\\iserver\\\\processingResultData\\\\Analyst\\\\udbs\\\\14ec67de-c7a5-42e0-9fae-0b9f65b7bf38\",\"datasetName\":\"analystResult\",\"type\":\"udb\"}"
],
"contextSetting": null,
"input": {
"datasetInfo": {
"available": true,
"bounds": "Left=-74.0012189965531,Bottom=40.691422739248694,Right=-73.84588071508979,Top=40.84578668020041",
"datasetName": "singleRegion_R",
"datasetType": "REGION",
"epsgCode": 4326,
"name": "test_processing_singleRegion_R",
"readOnly": false,
"type": "UDB",
"url": "E:\\data\\test\\processing.udb"
},
"datasetName": "test_processing_singleRegion_R",
"numSlices": 0
},
"mainClass": "com.supermap.bsp.main.SummaryWithinMeshMain",
"output": {
"datasetName": "analystResult",
"outputPath": "F:\\iserver-code\\iserver\\etc\\iserver-debug\\src\\test\\resources\\iserver\\processingResultData\\Analyst\\udbs\\14ec67de-c7a5-42e0-9fae-0b9f65b7bf38"
},
"serviceInfo": {
"targetDataPath": "F:\\iserver-code\\iserver\\etc\\iserver-debug\\src\\test\\resources\\iserver\\processingResultData\\Analyst\\48508e0b_d4b5_4278_bbde_9e092fe85618",
"targetServiceInfos": [
{
"serviceAddress": "http://supermapiserver:8090/iserver/services/data-summaryRegion73/rest",
"serviceType": "RESTDATA"
},
{
"serviceAddress": "http://supermapiserver:8090/iserver/services/map-summaryRegion64/rest",
"serviceType": "RESTMAP"
}
]
},
"serviceRoot": "http://supermapiserver:8090/iserver/services/",
"type": "SUMMARYMESH"
},
"state": {
"elapsedTime": 48120,
"endState": true,
"endTime": 1499671184678,
"errorMsg": null,
"errorStackTrace": null,
"publisherelapsedTime": 4970,
"runState": "FINISHED",
"startTime": 1499671126724
}
}]
创建一个区域汇总作业任务。
对 summaryRegion 资源执行 POST 请求,创建一个 区域汇总分析任务,请求体需包含参数如下:
名称 | 类型 | 含义 |
input 【必填参数】 |
DatasetInputDataSetting |
|
analyst |
SummaryWithinRegionAnalystSetting
SummaryWithinMeshAnalystSetting |
【以下不做特殊说明的均为必填参数】
分析配置。传入时,需指定:
|
type | SummaryAnalystType | 【必填参数】汇总类型,包含:
|
output 【选填参数】 |
FileSystemOutputSetting |
|
DatabaseOutputSetting |
|
对示例 summaryRegion 资源:http://supermapiserver:8090iserver/services/distributedanalyst/rest/v1/jobs/spatialanalyst/summaryregion.rjson 执行 POST 请求,输入一个已注册到iServer 的数据集,传入数据集名称即可。创建一个区域汇总任务。请求体中的参数如下:
{
"input": {
"datasetName": "smtiles_processing_newyorkZone_R"
},
"analyst": {
"sumShape": true,
"query": "-74.050,40.650,-73.850,40.850",
"mappingParameters": {
"numericPrecision": 2
},
"standardSummaryFields": true,
"standardFields": "LocationID",
"standardStatisticModes": "sum",
"weightedSummaryFields": false,
"meshType": "0",
"resolution": "1000",
"meshSizeUnit": "Meter"
},
"type": "SUMMARYMESH"
}
返回 rjson 格式的操作结果表述如下:
{
"newResourceID": "73b47027_b492_465d_b452_e88e40b1f503",
"newResourceLocation":"http://supermapiserver:8090/iserver/services/distributedanalyst/rest/v1/jobs/spatialanalyst/summaryregion/73b47027_b492_465d_b452_e88e40b1f503",
"postResultType": "CreateChild",
"succeed": true
}
对示例 summaryRegion 资源:http://supermapiserver:8090iserver/services/distributedanalyst/rest/v1/jobs/spatialanalyst/summaryregion.rjson 执行 POST 请求,输入数据为存储于PostgreSQL 数据库的数据。创建一个区域汇总任务。请求体中的参数如下:
{
"input": {
"datasetInfo": {
"type": "REGION",
"name": "newyorkZone_R_1359289148",
"datasourceConnectionInfo": {
"engineType": "POSTGRESQL",
"dataBase": "supermap4",
"password": "supermap",
"user": "postgres",
"server": "192.168.120.49"
}
}
},
"analyst":{
"regionDatasource":"{\"type\":\"pg\",\"info\":[{\"server\":\"192.168.120.49\",\"datasetNames\":[\"singleRegion_R_1359289148\"],\"database\":\"supermap4\",\"user\":\"postgres\",\"password\":\"supermap\"}]}",
"sumShape":"true",
"standardSummaryFields":"true",
"weightedSummaryFields":"false",
"standardFields":"LocationID",
"standardStatisticModes":"sum",
"query":"-74.050,40.650,-73.850,40.850"
},
"type":"SUMMARYREGION"
}
返回 rjson 格式的操作结果表述如下:
{
"newResourceID": "ca6464b6_63b3_419f_b3f7_4707827455e3",
"newResourceLocation": "http://supermapiserver:8090/iserver/services/distributedanalyst/rest/v1/jobs/spatialanalyst/vectorclip/ca6464b6_63b3_419f_b3f7_4707827455e3",
"postResultType": "CreateChild",
"succeed": true
}
对示例 summaryRegion 资源:http://supermapiserver:8090iserver/services/distributedanalyst/rest/v1/jobs/spatialanalyst/summaryregion.rjson 执行 POST 请求,以输入形式为数据集名称,该数据集已注册到iServer,参数中增加色带枚举值。默认输出。创建一个区域汇总任务。请求体中的参数如下:
{
"input": {
"datasetName": "samples_processing_newyorkZone_R"
},
"analyst": {
"sumShape": true,
"query": "",
"mappingParameters": {
"numericPrecision": 4,
"rangeMode": "STDDEVIATION",
"rangeCount": "7",
"colorGradientType": "SPECTRUM"
},
"standardSummaryFields": true,
"standardFields": "Shape_Leng",
"standardStatisticModes": "min",
"weightedSummaryFields": false,
"meshType": "1",
"resolution": "1000",
"meshSizeUnit": "Meter"
},
"type": "SUMMARYMESH"
}
返回 rjson 格式的操作结果表述如下:
{
"postResultType": "CreateChild",
"newResourceID": "3d6728c3_7e78_48f8_8d7f_18fbab683b68",
"succeed": true,
"newResourceLocation": "http://supermapiserver:8090/iserver/services/distributedanalyst/rest/v1/jobs/spatialanalyst/summaryregion/3d6728c3_7e78_48f8_8d7f_18fbab683b68"
}
返回跟 GET 请求一样的 HTTP 响应头,但是没有响应实体。可以在不必传输整个响应内容的情况下,获取包含在响应消息头中的元数据信息。元数据信息包括媒体类型,字符编码,压缩编码,实体内容长度等。
HEAD 请求可以用来判断 summaryRegion 资源是否存在,或者客户端是否有权限访问 summaryRegion 资源。通过对加.<format>的 URI 执行 HEAD 请求,还可以快速判断 summaryRegion 资源是否支持<format>格式的表述。