<spatialanalystJobs_uri>/overlay[.<format>]
叠加分析作业资源根目录。通过对 overlay 执行GET 请求,可获取当前系统的叠加分析作业列表。通过 POST 请求可创建一个分析任务。
支持的方法:
支持的表述格式:RJSON、JSON、HTML、XML。
对如下 URI 执行 HTTP 请求,以 rjson 输出格式为例加以说明,其中,supermapiserver 是服务器名。
http://supermapiserver:8090/iserver/services/distributedanalyst/rest/v1/jobs/spatialanalyst/overlay.rjson
获取叠加分析作业列表。
对 overlay 资源执行 GET 请求,在响应消息的实体主体里是一个叠加分析资源描述集,其中单个资源描述的结构如下:
名称 | 类型 | 含义 |
id | String | 应用ID。 |
state | SparkJobState | 该任务的状态。包括执行状态、起止时间、耗时等。 |
setting | SparkJobSetting | 列举了任务配置的详细信息。 |
对 overlay 资源执行 GET 请求,返回 rjson 格式的资源描述如下:
{
"id": "0c7f8574_2865_46f4_836b_b014af7747fb",
"setting": {
"DEFAULT_MASTER_ADRESS": "local[*] ",
"analyst": {
"attributeFilter": null,
"datasetOverlay": "samples_processing_newyorkZone_R",
"inputOverlay": "{\"type\":\"udb\",\"info\":[{\"server\":\"F:\\\\1.package\\\\20171010\\\\supermap_iserver_901_15410_4661_win64_zip\\\\samples\\\\data\\\\ProcessingData\\\\processing.udb\",\"datasetNames\":[\"newyorkZone_R\"]}]}",
"mode": "clip",
"overlayFields": null,
"srcFields": null
},
"appName": "overlayAnalyst",
"args": [
"--inputSource",
"{\"sliceNum\":20,\"type\":\"udb\",\"info\":[{\"server\":\"F:\\\\1.package\\\\20171010\\\\supermap_iserver_901_15410_4661_win64_zip\\\\samples\\\\data\\\\ProcessingData\\\\processing.udb\",\"datasetNames\":[\"newyorkZone_R\"]}]}",
"--inputOverlay",
"{\"type\":\"udb\",\"info\":[{\"server\":\"F:\\\\1.package\\\\20171010\\\\supermap_iserver_901_15410_4661_win64_zip\\\\samples\\\\data\\\\ProcessingData\\\\processing.udb\",\"datasetNames\":[\"newyorkZone_R\"]}]}",
"--mode",
"clip",
"--output",
"{\"server\":\"F:\\\\1.package\\\\20171010\\\\supermap_iserver_901_15410_4661_win64_zip\\\\webapps\\\\iserver\\\\processingResultData\\\\Analyst\\\\udbs\\\\18b2df44_1ba0_4a3d_9a5f_49f441f9a8bf\",\"datasetName\":\"analystResult\",\"blockingWrite\":\"true\",\"type\":\"udb\"}"
],
"contextSetting": null,
"input": {
"datasetInfo": {
"available": true,
"bounds": "Left=-74.25551784310493,Bottom=40.496084221255856,Right=-73.70014827248451,Top=40.91538866049913",
"datasetName": "newyorkZone_R",
"datasetType": "REGION",
"epsgCode": 4326,
"name": "samples_processing_newyorkZone_R",
"readOnly": false,
"type": "UDB",
"url": "../../samples/data/ProcessingData/processing.udb"
},
"datasetName": "samples_processing_newyorkZone_R",
"numSlices": 0
},
"mainClass": "com.supermap.bdt.main.OverlayAnalystMain",
"output": {
"datasetName": "analystResult",
"datasourcePath": "F:\\1.package\\20171010\\supermap_iserver_901_15410_4661_win64_zip\\webapps\\iserver\\processingResultData\\Analyst\\0c7f8574_2865_46f4_836b_b014af7747fb\\18b2df44_1ba0_4a3d_9a5f_49f441f9a8bf.udb",
"outputPath": "F:\\1.package\\20171010\\supermap_iserver_901_15410_4661_win64_zip\\webapps\\iserver\\processingResultData\\Analyst\\0c7f8574_2865_46f4_836b_b014af7747fb\\overlayAnalystGeo.smwu",
"type": "udb"
},
"serviceInfo": {
"targetDataPath": "F:\\1.package\\20171010\\supermap_iserver_901_15410_4661_win64_zip\\webapps\\iserver\\processingResultData\\Analyst\\0c7f8574_2865_46f4_836b_b014af7747fb\\overlayAnalystGeo.smwu",
"targetServiceInfos": [
{
"serviceAddress": "http://localhost:8090/iserver/services/map-overlayAnalystGeo/rest",
"serviceType": "RESTMAP"
},
{
"serviceAddress": "http://localhost:8090/iserver/services/data-overlayAnalystGeo/rest",
"serviceType": "RESTDATA"
}
]
},
"serviceRoot": "http://localhost:8090/iserver/services/",
"sparkLogFile": null
},
"state": {
"elapsedTime": 12163,
"endState": true,
"endTime": 1507626494661,
"errorMsg": null,
"errorStackTrace": null,
"publisherelapsedTime": 2481,
"runState": "FINISHED",
"startTime": 1507626474881
}
}
创建一个叠加分析任务。
对 overlay 资源执行 POST 请求,创建一个 叠加分析任务,请求体需包含参数如下:
名称 | 类型 | 含义 |
input 【必填参数】 |
DatasetInputDataSetting |
|
analyst |
OverlayAnalystSetting | 【必填参数】分析配置。传入时,需指定:
|
output 【选填参数】 |
FileSystemOutputSetting |
|
DatabaseOutputSetting |
|
对示例 overlay 资源:http://supermapiserver:8090/iserver/services/distributedanalyst/rest/v1/jobs/spatialanalyst/overlay .rjson 以输入形式为数据集名称,该数据集已注册到iServer。方式执行POST 请求,创建一个叠加分析任务。请求体中的参数如下:
{
"input":{
"datasetName":"samples_processing_newyorkZone_R"
},
"analyst":{
"datasetOverlay":"samples_processing_newyorkZone_R",
"mode":"clip"
}
}
返回 rjson 格式的操作结果表述如下:
{
"newResourceID": "b050cd70_d849_444a_ac43_75d7c0569809",
"newResourceLocation":"http://supermapiserver:8090/iserver/services/distributedanalyst/rest/v1/jobs/spatialanalyst/overlay/b050cd70_d849_444a_ac43_75d7c0569809",
"postResultType": "CreateChild",
"succeed": true
}
对示例 overlay 资源:http://supermapiserver:8090/iserver/services/distributedanalyst/rest/v1/jobs/spatialanalyst/overlay .rjson 执行 POST 请求,输入数据为存储于PostgreSQL 数据库的数据。 创建一个叠加分析任务。请求体中的参数如下:
{
"input": {
"datasetInfo": {
"type": "REGION",
"name": "newyorkRoads_L_1056690886",
"datasourceConnectionInfo": {
"engineType": "POSTGRESQL",
"dataBase": "supermap",
"password": "supermap",
"user": "postgres",
"server": "192.168.120.21"
}
}
},
"analyst":{
"inputOverlay":"{\"type\":\"pg\",\"info\":[{\"server\":\"192.168.120.21\",\"datasetNames\":[\"newyorkZone_R_1056690886\"],\"database\":\"supermap\",\"user\":\"postgres\",\"password\":\"supermap\"}]}",
"mode":"intersect"
}
}
返回 rjson 格式的操作结果表述如下:
{
"newResourceID": "f2221b2c_943d_4214_b30b_f9fb965c0c59",
"newResourceLocation": "http://supermapiserver:8090/iserver/services/distributedanalyst/rest/v1/jobs/spatialanalyst/overlay/f2221b2c_943d_4214_b30b_f9fb965c0c59",
"postResultType": "CreateChild",
"succeed": true
}
对示例 overlay 资源:http://supermapiserver:8090/iserver/services/distributedanalyst/rest/v1/jobs/spatialanalyst/overlay .rjson 执行 POST 请求,输入数据为存储于hdfs上面的索引文件。 创建一个叠加分析任务。请求体中的参数如下:
{
"input": {
"datasetInfo": {
"type": "INDEXEDHDFS",
"url": "hdfs://192.168.112.126:9000/data/newyorkZone_index"
}
},
"analyst": {
"datasetOverlay": "samples_processing_singleRegion_R",
"mode": "clip"
}
}
返回 rjson 格式的操作结果表述如下:
{
"newResourceID": "a15a36f6_7ee0_4cef_819c_aeb639e4e9df",
"newResourceLocation": "http://supermapiserver:8090/iserver/services/distributedanalyst/rest/v1/jobs/spatialanalyst/overlay/a15a36f6_7ee0_4cef_819c_aeb639e4e9df",
"postResultType": "CreateChild",
"succeed": true
}
对示例 overlay 资源:http://supermapiserver:8090/iserver/services/distributedanalyst/rest/v1/jobs/spatialanalyst/overlay.rjson 执行 POST 请求, 创建一个叠加分析任务。请求体中的参数如下:
{
"input": {
"datasetName": "samples_processing_newyorkZone_R"
},
"analyst": {
"datasetOverlay": "samples_processing_singleRegion_R",
"mode": "clip"
},
"output": {
"type": "mongodb",
"datasetName": "analystResult693",
"datasourceInfo": {
"server": "mongodb://192.168.120.21:27017/",
"dataBase": "Overlaybase",
"engineType": "MONGODB",
"alias": "OverlayTest"
}
}
}
返回 rjson 格式的操作结果表述如下:
{
"newResourceID": "c5e5f3ad_e10d_4166_9e41_5a779c13d9dd",
"newResourceLocation": "http://supermapiserver:8090/iserver/services/distributedanalyst/rest/v1/jobs/spatialanalyst/overlay/c5e5f3ad_e10d_4166_9e41_5a779c13d9dd",
"postResultType": "CreateChild",
"succeed": true
}
返回跟 GET 请求一样的 HTTP 响应头,但是没有响应实体。可以在不必传输整个响应内容的情况下,获取包含在响应消息头中的元数据信息。元数据信息包括媒体类型,字符编码,压缩编码,实体内容长度等。
HEAD 请求可以用来判断 overlay 资源是否存在,或者客户端是否有权限访问 overlay 资源。通过对加.<format>的 URI 执行 HEAD 请求,还可以快速判断 overlay 资源是否支持<format>格式的表述。