<spatialanalystJobs_uri>/vectorclip[.<format>]
矢量裁剪作业资源根目录。通过对 vectorClip 执行GET 请求,可获取当前系统的矢量裁剪作业列表。通过 POST 请求可创建一个矢量裁剪任务。
支持的方法:
支持的表述格式:RJSON、JSON、HTML、XML。
对如下 URI 执行 HTTP 请求,以 rjson 输出格式为例加以说明,其中,supermapiserver 是服务器名。
http://supermapiserver:8090/iserver/services/distributedanalyst/rest/v1/jobs/spatialanalyst/vectorclip.rjson
获取矢量裁剪作业列表。
对 vectorClip 资源执行 GET 请求,在响应消息的实体主体里是一个矢量裁剪资源描述集,其中单个资源描述的结构如下:
字段 | 类型 | 说明 |
id | String | 应用ID。 |
state | SparkJobState | 该任务的状态。包括执行状态、起止时间、耗时等。 |
setting | SparkJobSetting | 列举了任务配置的详细信息。 |
对 vectorClip 资源执行 GET 请求,返回 rjson 格式的资源描述如下:
[{
"id": "a4d3f1c0_bd7e_4c3d_a63e_b02f76a293a9",
"setting": {
"DEFAULT_MASTER_ADRESS": "local[*] ",
"analyst": {
"datasetOverlay": "New_Region",
"inputOverlay": "F:\\20170608\\onere\\onere.udb",
"mode": "clip",
"numSlices": "20"
},
"appName": "vectorClip",
"args": [
"--inputSource",
"F:\\20170608\\onere\\onere.udb",
"--datasetSource",
"zone",
"--numSlices",
"20",
"--inputOverlay",
"F:\\20170608\\onere\\onere.udb",
"--datasetOverlay",
"New_Region",
"--mode",
"clip",
"--outputResult",
"F:\\20170608\\supermap_iserver_900_15008_4414_win64_zip\\webapps\\iserver\\processingResultData\\Analyst\\udbs\\fdae17ca-782b-4729-83d0-bfefb573377d",
"--datasetResult",
"analystResult"
],
"contextSetting": null,
"input": {
"datasetSource": "zone",
"inputSource": "F:\\20170608\\onere\\onere.udb"
},
"mainClass": "com.supermap.bsp.main.vectorClipMain",
"output": {
"cacheName": null,
"cacheType": null,
"datasetResult": "analystResult",
"outputResult": "F:\\20170608\\supermap_iserver_900_15008_4414_win64_zip\\webapps\\iserver\\processingResultData\\Analyst\\udbs\\fdae17ca-782b-4729-83d0-bfefb573377d"
},
"serviceInfo": {
"targetDataPath": "F:\\20170608\\supermap_iserver_900_15008_4414_win64_zip\\webapps\\iserver\\processingResultData\\Analyst\\a4d3f1c0_bd7e_4c3d_a63e_b02f76a293a9",
"targetServiceInfos": [
{
"serviceAddress": "http://localhost:8090/iserver/services/map-vectorClip2/rest",
"serviceType": "RESTMAP"
},
{
"serviceAddress": "http://localhost:8090/iserver/services/data-vectorClip2/rest",
"serviceType": "RESTDATA"
}
]
},
"serviceRoot": "http://localhost:8090/iserver/services/"
},
"state": {
"elapsedTime": 12091,
"endState": true,
"endTime": 1496911750621,
"errorMsg": null,
"errorStackTrace": null,
"publisherelapsedTime": 2804,
"runState": "FINISHED",
"startTime": 1496911733481
}
}]
创建一个矢量裁剪任务。
对 vectorClip 资源执行 POST 请求,创建一个 矢量裁剪任务,请求体需包含参数如下:
名称 | 类型 | 含义 |
input 【必填参数】 |
DatasetInputDataSetting |
|
FileCSVInputDataSetting |
|
|
analyst |
OverlayAnalystGeoSetting | 【必填参数】分析配置。传入时,需指定:
|
output 【选填参数】 |
FileSystemOutputSetting |
|
DatabaseOutputSetting |
|
对示例 vectorClip 资源:http://supermapiserver:8090/iserver/services/distributedanalyst/rest/v1/jobs/spatialanalyst/vectorclip.rjson 执行 POST 请求,输入一个已注册到iServer 的数据集,传入数据集名称即可。创建一个矢量裁剪任务。请求体中的参数如下:
{
"input": {
"datasetName": "samples_processing_newyorkZone_R"
},
"analyst": {
"datasetVectorClip": "samples_processing_singleRegion_R",
"mode": "clip"
}
}
返回 rjson 格式的操作结果表述如下:
{
"newResourceID": "f88cd129_a989_4f6c_a8e0_4f9d225f6b54",
"newResourceLocation": "http://supermapiserver:8090/iserver/services/distributedanalyst/rest/v1/jobs/spatialanalyst/vectorclip/f88cd129_a989_4f6c_a8e0_4f9d225f6b54",
"postResultType": "CreateChild",
"succeed": True
}
对示例 vectorClip 资源:http://supermapiserver:8090/iserver/services/distributedanalyst/rest/v1/jobs/spatialanalyst/vectorclip.rjson 执行 POST 请求,输入数据为存储于PostgreSQL 数据库的数据。创建一个矢量裁剪任务。请求体中的参数如下:
{
"input": {
"datasetInfo": {
"type": "REGION",
"name": "zone",
"datasourceConnectionInfo": {
"engineType": "POSTGRESQL",
"dataBase": "supermap4",
"password": "supermap",
"user": "postgres",
"server": "192.168.120.49"
}
}
},
"analyst":{
"inputVectorClip": "{\"type\":\"udb\",\"info\":[{\"server\":\"D:/data/zone.udb\",\"datasetNames\":[\"New_Region\"]}],\"attributeFilter\":\"SMID=1\"}",
"mode":"clip"
}
}
返回 rjson 格式的操作结果表述如下:
{
"newResourceID": "b53a553f_a099_4baf_bc30_e68c41d08cf0",
"newResourceLocation": "http://supermapiserver:8090/iserver/services/distributedanalyst/rest/v1/jobs/spatialanalyst/vectorclip/b53a553f_a099_4baf_bc30_e68c41d08cf0",
"postResultType": "CreateChild",
"succeed": True
}
对示例 vectorClip 资源:http://supermapiserver:8090/iserver/services/distributedanalyst/rest/v1/jobs/spatialanalyst/vectorclip.rjson 执行 POST 请求,输入一个geometry,并且设置了缓冲区。创建一个矢量裁剪任务。请求体中的参数如下:
{
"input": {
"datasetName": "samples_processing_newyorkZone_R"
},
"analyst": {
"geometryClip": "{\"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": "clip"
}
}
返回 rjson 格式的操作结果表述如下:
{
"newResourceID": "4197351c_cfe6_43fe_83a8_e97cf1327cf3",
"newResourceLocation": "http://supermapiserver:8090/iserver/services/distributedanalyst/rest/v1/jobs/spatialanalyst/vectorclip/4197351c_cfe6_43fe_83a8_e97cf1327cf3",
"postResultType": "CreateChild",
"succeed": True
}
返回跟 GET 请求一样的 HTTP 响应头,但是没有响应实体。可以在不必传输整个响应内容的情况下,获取包含在响应消息头中的元数据信息。元数据信息包括媒体类型,字符编码,压缩编码,实体内容长度等。
HEAD 请求可以用来判断 vectorClip 资源是否存在,或者客户端是否有权限访问 vectorClip 资源。通过对加.<format>的 URI 执行 HEAD 请求,还可以快速判断 vectorClip 资源是否支持<format>格式的表述。