<dataprocessingJobs_uri>/buildregiongrid[.<format>]
构造区域格网资源根目录。通过对 buildRegionGrid 执行GET 请求,可获取当前系统的构造区域格网作业列表。通过 POST 请求可创建一个分析任务。
支持的方法:
支持的表述格式:RJSON、JSON、HTML、XML。
对如下 URI 执行 HTTP 请求,以 rjson 输出格式为例加以说明,其中,supermapiserver 是服务器名。
http://supermapiserver:8090/iserver/services/distributedanalyst/rest/v1/jobs/dataprocessing/buildregiongrid.rjson
获取构造区域格网作业列表。
对 buildRegionGrid 资源执行 GET 请求,在响应消息的实体主体里是一个构造区域格网资源描述集,其中单个资源描述的结构如下:
字段 | 类型 | 说明 |
id | String | 应用ID。 |
state | SparkJobState | 该任务的状态。包括执行状态、起止时间、耗时等。 |
setting | SparkJobSetting | 列举了任务配置的详细信息。 |
对 buildRegionGrid 资源执行 GET 请求,返回 rjson 格式的资源描述如下:
[
{
"id": "677c4aaf_cd4b_4837_ab0f_7bc4e2a0f08b",
"state": {
"errorStackTrace": null,
"endState": true,
"startTime": 1539237320440,
"endTime": 1539237353946,
"publisherelapsedTime": 2491,
"runState": "FINISHED",
"errorMsg": null,
"elapsedTime": 30437
},
"setting": {
"output": {
"outputPath": "F:\\01_package\\20181010\\supermap_iserver_910_16609_3565_win64_deploy\\webapps\\iserver\\processingResultData\\Analyst\\677c4aaf_cd4b_4837_ab0f_7bc4e2a0f08b\\buildregiongrid.smwu",
"datasourcePath": "F:\\01_package\\20181010\\supermap_iserver_910_16609_3565_win64_deploy\\webapps\\iserver\\processingResultData\\Analyst\\677c4aaf_cd4b_4837_ab0f_7bc4e2a0f08b\\340c2810_4c9f_4052_b7f8_ab4af53cb1b7.udb",
"datasetName": "analystResult",
"type": "UDB"
},
"args": null,
"input": {
"datasetName": "samples_processing_singleRegion_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
}
],
"epsgCode": 4326,
"datasetName": "singleRegion_R",
"bounds": "Left=-74.0012189965531,Bottom=40.691422739248694,Right=-73.84588071508979,Top=40.84578668020041",
"available": true,
"name": "samples_processing_singleRegion_R",
"readOnly": false,
"datasetType": "REGION",
"type": "UDB",
"url": "F:\\01_package\\ProcessingData\\processing.udb"
}
},
"DEFAULT_MASTER_ADRESS": "local[*] ",
"referToken": "d4MIZB1FF6IKu3eUH5IYpabwyLcLYeBEDee9yn-O5WyQo5lyLNArFQHdzNrlTNYWTGm-n6yvG04qkwpnFer6ZA..",
"mainClass": null,
"sparkLogFile": null,
"appName": null,
"analyst": {
"distanceUnit": "Meter",
"datasetPoint": "samples_processing_newyorkPoint_P",
"IDField": "passenger_count",
"inputPointData": "{\"type\":\"udb\",\"info\":[{\"server\":\"F:\\\\01_package\\\\ProcessingData\\\\processing.udb\",\"datasetNames\":[\"newyorkPoint_P\"]}]}",
"width": 100,
"summaryFields": [
"passenger_count"
],
"statisticsSameID": false,
"height": 100,
"summaryStatisticModes": [
"MIN"
]
},
"contextSetting": null,
"serviceInfo": {
"targetDataPath": "F:\\01_package\\20181010\\supermap_iserver_910_16609_3565_win64_deploy\\webapps\\iserver\\processingResultData\\Analyst\\677c4aaf_cd4b_4837_ab0f_7bc4e2a0f08b\\buildregiongrid.smwu",
"targetServiceInfos": [
{
"serviceType": "RESTDATA",
"serviceAddress": "http://192.168.120.21:8090/iserver/services/data-buildregiongrid16/rest"
},
{
"serviceType": "RESTMAP",
"serviceAddress": "http://192.168.120.21:8090/iserver/services/map-buildregiongrid16/rest"
}
]
},
"referServicesAddress": "http://192.168.120.21:8090/iserver"
}
}
]
创建一个构造区域格网任务
对 buildRegionGrid 资源执行 POST 请求,创建一个构造区域格网任务,请求体需包含参数如下:
名称 | 类型 | 含义 |
input 【必填参数】 |
DatasetInputDataSetting |
|
analyst |
BuildRegionGridSetting | 【以下不做特殊说明的均为必填参数】分析配置。传入时,需指定:
|
output 【选填参数】 |
FileSystemOutputSetting |
|
DatabaseOutputSetting |
|
对示例 buildRegionGrid 资源:http://supermapiserver:8090/iserver/services/distributedanalyst/rest/v1/jobs/dataprocessing/buildregiongrid.json 输入形式为数据集名称,该数据集已注册到iServer。执行POST 请求,创建一个构造区域格网任务。请求体中的参数如下:
{
"input": {
"datasetName": "samples_processing_singleRegion_R"
},
"analyst": {
"height": "100",
"width": "100",
"distanceUnit": "Meter",
"datasetPoint": "samples_processing_newyorkPoint_P",
"IDField": "passenger_count",
"summaryFields": [
"passenger_count"
],
"summaryStatisticModes": [
"MIN"
],
"statisticsSameID": false
}
}
返回 rjson 格式的操作结果表述如下:
{
"postResultType": "CreateChild",
"newResourceID": "677c4aaf_cd4b_4837_ab0f_7bc4e2a0f08b",
"succeed": true,
"newResourceLocation": "http://supermapiserver:8090/iserver/services/distributedanalyst/rest/v1/jobs/dataprocessing/buildregiongrid/677c4aaf_cd4b_4837_ab0f_7bc4e2a0f08b"
}
对示例 buildRegionGrid 资源:http://supermapiserver:8090/iserver/services/distributedanalyst/rest/v1/jobs/dataprocessing/buildregiongrid.json 执行POST 请求,创建一个构造区域格网任务,使输出结果存到PostGIS中。请求体中的参数如下:
{
"input": {
"datasetName": "samples_processing_singleRegion_R"
},
"analyst": {
"height": "100",
"Width": "100",
"distanceUnit": "Meter",
"datasetPoint": "samples_processing_newyorkPoint_P",
"IDField": "passenger_count",
"summaryFields": [
"passenger_count"
],
"summaryStatisticModes": [
"MIN"
],
"statisticsSameID": false
},
"output": {
"type": "POSTGIS",
"datasetName": "analystResult1",
"datasourceInfo": {
"server": "192.168.120.21",
"dataBase": "iserver070",
"engineType": "POSTGIS",
"user": "postgres",
"password": "postgres"
}
}
}
返回 rjson 格式的操作结果表述如下:
{
"postResultType": "CreateChild",
"newResourceID": "ce4e4fdf_ad8b_4afa_8d79_34142b01f2cc",
"succeed": true,
"newResourceLocation": "http://supermapiserver:8090/iserver/services/distributedanalyst/rest/v1/jobs/dataprocessing/buildregiongrid/ce4e4fdf_ad8b_4afa_8d79_34142b01f2cc"
}
对示例 buildRegionGrid 资源:http://supermapiserver:8090/iserver/services/distributedanalyst/rest/v1/jobs/dataprocessing/buildregiongrid.json 输入形式为数据集文件路径及信息,该数据集未注册到iServer中,执行POST 请求,创建一个构造区域格网任务。请求体中的参数如下:
{
"input": {
"datasetInfo": {
"type": "REGION",
"name": "singleRegion_R",
"datasourceConnectionInfo": {
"engineType": "POSTGIS",
"dataBase": "iserver070",
"password": "supermap",
"user": "postgres",
"server": "192.168.120.21"
}
}
},
"analyst": {
"height": "100",
"Width": "100",
"distanceUnit": "Meter",
"datasetPoint": "samples_processing_newyorkPoint_P",
"IDField": "passenger_count",
"summaryFields": [
"passenger_count"
],
"summaryStatisticModes": [
"MIN"
],
"statisticsSameID": false
}
}
返回 rjson 格式的操作结果表述如下:
{
"postResultType": "CreateChild",
"newResourceID": "9077b74d_8816_4c57_b490_38e1393a5cc0",
"succeed": true,
"newResourceLocation": "http://supermapiserver:8090/iserver/services/distributedanalyst/rest/v1/jobs/dataprocessing/buildregiongrid/9077b74d_8816_4c57_b490_38e1393a5cc0"
}
返回跟 GET 请求一样的 HTTP 响应头,但是没有响应实体。可以在不必传输整个响应内容的情况下,获取包含在响应消息头中的元数据信息。元数据信息包括媒体类型,字符编码,压缩编码,实体内容长度等。
HEAD 请求可以用来判断 buildRegionGrid 资源是否存在,或者客户端是否有权限访问 buildRegionGrid 资源。通过对加.<format>的 URI 执行 HEAD 请求,还可以快速判断 buildRegionGrid 资源是否支持<format>格式的表述。