<spatialanalystJobs_uri>/buffers[.<format>]
缓冲区分析作业资源根目录。通过对 buffers 执行GET 请求,可获取当前系统的缓冲区分析作业列表。通过 POST 请求可创建一个分析任务。
支持的方法:
支持的表述格式:RJSON、JSON、HTML、XML。
对如下 URI 执行 HTTP 请求,以 rjson 输出格式为例加以说明,其中,supermapiserver 是服务器名。
http://supermapiserver:8090/iserver/services/distributedanalyst/rest/v1/jobs/spatialanalyst/buffers.rjson
获取缓冲区分析作业列表。
对 buffers 资源执行 GET 请求,在响应消息的实体主体里是一个缓冲区分析资源描述集,其中单个资源描述的结构如下:
字段 | 类型 | 说明 |
id | String | 应用ID。 |
state | SparkJobState | 该任务的状态。包括执行状态、起止时间、耗时等。 |
setting | SparkJobSetting | 列举了任务配置的详细信息。 |
对 buffers 资源执行 GET 请求,返回 rjson 格式的资源描述如下:
{
"id": "8e57bf84_bb5d_4167_9e86_d9c533790d06",
"setting": {
"DEFAULT_MASTER_ADRESS": "local[*] ",
"analyst": {
"bounds": "",
"dissolveField": "LocationID",
"distance": "100",
"distanceField": "",
"distanceUnit": "Meter"
},
"appName": "CreateBuffers",
"args": [
"--input",
"{\"sliceNum\":20,\"type\":\"udb\",\"info\":[{\"server\":\"F:\\\\1.package\\\\20171014\\\\supermap_iserver_901_15413_4668_win64_zip\\\\samples\\\\data\\\\ProcessingData\\\\processing.udb\",\"datasetNames\":[\"newyorkZone_R\"]}]}",
"--distance",
"100",
"--distanceUnit",
"Meter",
"--dissolveField",
"LocationID",
"--output",
"{\"server\":\"192.168.120.21\",\"password\":\"supermap\",\"database\":\"supermap1\",\"datasetName\":\"analystResult_2091235435\",\"blockingWrite\":null,\"type\":\"pg\",\"user\":\"postgres\"}"
],
"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.CreateBuffersMain",
"output": {
"datasetName": "analystResult_2091235435",
"datasourceInfo": {
"alias": "supermap1_pg",
"connect": true,
"dataBase": "supermap1",
"driver": "PostgreSQL ANSI",
"engineType": "POSTGRESQL",
"exclusive": false,
"openLinkTable": false,
"password": "supermap",
"readOnly": false,
"server": "192.168.120.21",
"user": "postgres"
},
"outputPath": "F:\\1.package\\20171014\\supermap_iserver_901_15413_4668_win64_zip\\webapps\\iserver\\processingResultData\\Analyst\\8e57bf84_bb5d_4167_9e86_d9c533790d06\\buffers.smwu",
"type": "pg"
},
"serviceInfo": {
"targetDataPath": "F:\\1.package\\20171014\\supermap_iserver_901_15413_4668_win64_zip\\webapps\\iserver\\processingResultData\\Analyst\\8e57bf84_bb5d_4167_9e86_d9c533790d06\\buffers.smwu",
"targetServiceInfos": [
{
"serviceAddress": "http://supermapiserver:8090/iserver/services/data-buffers4/rest",
"serviceType": "RESTDATA"
},
{
"serviceAddress": "http://supermapiserver:8090/iserver/services/map-buffers4/rest",
"serviceType": "RESTMAP"
}
]
},
"serviceRoot": "http://supermapiserver:8090/iserver/services/",
"sparkLogFile": null
},
"state": {
"elapsedTime": 19023,
"endState": true,
"endTime": 1508206175930,
"errorMsg": null,
"errorStackTrace": null,
"publisherelapsedTime": 4287,
"runState": "FINISHED",
"startTime": 1508206149260
}
}
创建一个缓冲区分析任务。
对 buffers 资源执行 POST 请求,创建一个 缓冲区分析任务,请求体需包含参数如下:
名称 | 类型 | 含义 |
input 【必填参数】 |
DatasetInputDataSetting |
|
FileCSVInputDataSetting |
|
|
analyst |
BuffersAnalystSetting | 分析配置。传入时,需指定:
|
output 【选填参数】 |
FileSystemOutputSetting |
|
DatabaseOutputSetting |
|
对示例 buffers 资源:http://supermapiserver:8090/iserver/services/distributedanalyst/rest/v1/jobs/spatialanalyst/buffers.rjson 以输入形式为数据集名称,该数据集已注册到iServer。方式执行POST 请求,创建一个缓冲区分析任务。请求体中的参数如下:
{
"input": {
"datasetName": "samples_processing_newyorkZone_R"
},
"analyst": {
"bounds": "-74.050,40.650,-73.850,40.850",
"distance": "100",
"distanceField": "distance",
"distanceUnit": "Meter",
"dissolveField": "LocationID"
}
}
返回 rjson 格式的操作结果表述如下:
{
"newResourceID": "2448867c_c77f_4335_9e39_65fd65964fdb",
"newResourceLocation":"http://supermapiserver:8090/iserver/services/distributedanalyst/rest/v1/jobs/spatialanalyst/buffers/2448867c_c77f_4335_9e39_65fd65964fdb",
"postResultType": "CreateChild",
"succeed":true
}
对示例 buffers 资源:http://supermapiserver:8090/iserver/services/distributedanalyst/rest/v1/jobs/spatialanalyst/buffers.rjson 执行 POST 请求,输入数据为存储于PostgreSQL 数据库的数据。 创建一个缓冲区分析任务。请求体中的参数如下:
{
"input": {
"datasetInfo": {
"type": "REGION",
"name": "newyorkZone_R_1522375355",
"datasourceConnectionInfo": {
"engineType": "POSTGRESQL",
"dataBase": "supermap",
"password": "supermap",
"user": "postgres",
"server": "192.168.120.21"
}
}
},
"analyst": {
"bounds": "",
"distance": "",
"distanceField": "",
"distanceUnit": "Meter",
"dissolveField": "LOCATIONID"
}
}
返回 rjson 格式的操作结果表述如下:
{
"newResourceID": "7b4a46ea_1a95_4524_8238_bc169b5e0df3",
"newResourceLocation":"http://supermapiserver:8090/iserver/services/distributedanalyst/rest/v1/jobs/spatialanalyst/buffers/7b4a46ea_1a95_4524_8238_bc169b5e0df3",
"postResultType": "CreateChild",
"succeed": true
}
返回跟 GET 请求一样的 HTTP 响应头,但是没有响应实体。可以在不必传输整个响应内容的情况下,获取包含在响应消息头中的元数据信息。元数据信息包括媒体类型,字符编码,压缩编码,实体内容长度等。
HEAD 请求可以用来判断 buffers 资源是否存在,或者客户端是否有权限访问 buffers 资源。通过对加.<format>的 URI 执行 HEAD 请求,还可以快速判断 buffers 资源是否支持<format>格式的表述。