<spatialanalystJobs_uri>/density[.<format>]
密度分析作业资源根目录。通过对 density 执行GET 请求,可获取当前系统的密度分析作业列表。通过 POST 请求可创建一个分析任务。
支持的方法:
支持的表述格式:RJSON、JSON、HTML、XML。
对如下 URI 执行 HTTP 请求,以 rjson 输出格式为例加以说明,其中,supermapiserver 是服务器名。
http://supermapiserver:8090/iserver/services/distributedanalyst/rest/v1/jobs/spatialanalyst/density.rjson
获取密度分析作业资源。
对 density 资源执行 GET 请求,在响应消息的实体主体里是一个密度分析资源描述集,其中单个资源描述的结构如下:
字段 | 类型 | 说明 |
id | String | 应用ID。 |
state | SparkJobState | 该任务的状态。包括执行状态、起止时间、耗时等。 |
setting | SparkJobSetting | 列举了任务配置的详细信息。 |
对 density 资源执行 GET 请求,返回 rjson 格式的资源描述如下:
[
{
"id": "546fdbc5_81c3_49a8_8341_1f2fd696da8f",
"setting": {
"DEFAULT_MASTER_ADRESS": "local[*] ",
"analyst": {
"fields": "",
"meshType": "0",
"method": "0",
"query": "",
"radius": "0.01",
"resolution": "0.001"
},
"appName": "density",
"args": [
"--input",
"{\"sliceNum\":20,\"type\":\"udb\",\"info\":[{\"server\":\"F:\\\\20170707\\\\China\\\\China.udb\",\"datasetNames\":[\"China_Capital_pt\"]}]}",
"--radius",
"0.01",
"--method",
"uniform",
"--meshType",
"square",
"--meshSize",
"0.001",
"--output",
"{\"server\":\"F:\\\\20170707\\\\supermap_iserver_win64_zip\\\\webapps\\\\iserver\\\\processingResultData\\\\Analyst\\\\udbs\\\\4ab58165-a839-4c80-b8b2-1a2d98ad465b\",\"datasetName\":\"analystResult\",\"type\":\"udb\"}"
],
"contextSetting": null,
"input": {
"datasetInfo": {
"available": true,
"bounds": "Left=1.2957801616844445E7,Bottom=4852151.575504352,Right=1.2957801616844445E7,Top=4852151.575504352",
"datasetName": "China_Capital_pt",
"datasetType": "POINT",
"epsgCode": 3857,
"name": "China_China_China_Capital_pt",
"readOnly": false,
"type": "UDB",
"url": "F:\\20170707\\China\\China.udb"
},
"datasetName": "China_China_China_Capital_pt",
"numSlices": 0
},
"mainClass": "com.supermap.bsp.main.DensityAnalystMain",
"output": {
"datasetName": "analystResult",
"outputPath": "F:\\20170707\\supermap_iserver_win64_zip\\webapps\\iserver\\processingResultData\\Analyst\\udbs\\4ab58165-a839-4c80-b8b2-1a2d98ad465b"
},
"serviceInfo": {
"targetDataPath": "F:\\20170707\\supermap_iserver_win64_zip\\webapps\\iserver\\processingResultData\\Analyst\\546fdbc5_81c3_49a8_8341_1f2fd696da8f",
"targetServiceInfos": [
{
"serviceAddress": "http://supermapiserver:8090/iserver/services/map-kernelDensity8/rest",
"serviceType": "RESTMAP"
},
{
"serviceAddress": "http://supermapiserver:8090/iserver/services/data-kernelDensity8/rest",
"serviceType": "RESTDATA"
}
]
},
"serviceRoot": "http://supermapiserver:8090/iserver/services/"
},
"state": {
"elapsedTime": 6096,
"endState": true,
"endTime": 1499417671510,
"errorMsg": null,
"errorStackTrace": null,
"publisherelapsedTime": 1702,
"runState": "FINISHED",
"startTime": 1499417662453
}
}
]
创建一个核密度分析任务。
对 density 资源执行 POST 请求,创建一个核密度分析任务,请求体需包含参数如下:
名称 | 类型 | 含义 |
input 【必填参数】 |
DatasetInputDataSetting |
|
FileCSVInputDataSetting |
|
|
analyst |
KernelDensityAnalystSetting | 【必填参数】分析配置。传入时,需指定:
|
output 【选填参数】 |
FileSystemOutputSetting |
|
DatabaseOutputSetting |
|
对示例 density 资源:http://supermapiserver:8090/iserver/services/distributedanalyst/rest/v1/jobs/spatialanalyst/density.rjson 执行 POST 请求,输入已注册到 iServer 的udb文件,创建一个点密度分析任务。请求体中的参数如下:
{
"input":{
"datasetName":"China_China_China_Capital_pt"
},
"analyst": {
"query": "",
"resolution": "10",
"radius": "100",
"method": "0",
"meshType": "0",
"fields": "",
"meshSizeUnit": "Meter",
"radiusUnit": "Meter",
"areaUnit": "SquareMeter"
}
}
返回 rjson 格式的操作结果表述如下:
{
"newResourceID": "8bf67620_2c3a_4752_8cce_30076f3fe94e",
"newResourceLocation":"http://supermapiserver:8090/iserver/services/distributedanalyst/rest/v1/jobs/spatialanalyst/density/8bf67620_2c3a_4752_8cce_30076f3fe94e",
"postResultType": "CreateChild",
"succeed": true
}
对示例 density 资源:http://supermapiserver:8090/iserver/services/distributedanalyst/rest/v1/jobs/spatialanalyst/density.rjson 执行 POST 请求,用输入为的udb文件,创建一个核密度分析任务。请求体中的参数如下:
{
"input": {
"datasetInfo": {
"type": "UDB",
"url": "F:\\20170707\\China\\China.udb",
"datasetType": "POINT",
"datasetName": "China_Capital_pt"
},
"numSlices":36
},
"analyst": {
"query": "",
"resolution": "10",
"radius": "100",
"method": "0",
"meshType": "0",
"fields": ""
}
}
返回 rjson 格式的操作结果表述如下:
{
"newResourceID": "015fb79a_0f32_49d1_a0a9_743c10052156",
"newResourceLocation":"http://supermapiserver:8090/iserver/services/distributedanalyst/rest/v1/jobs/spatialanalyst/density/015fb79a_0f32_49d1_a0a9_743c10052156",
"postResultType": "CreateChild",
"succeed": true
}
对示例 densitys 资源:http://supermapiserver:8090/iserver/services/distributedanalyst/rest/v1/jobs/spatialanalyst/density.rjson 执行 POST 请求,输入未注册到 iServer 的 PostgreSQL 中存储的数据,创建一个核密度分析任务。请求体中的参数如下:
{
"input": {
"datasetInfo": {
"type": "POINT",
"name": "newyorkPoint_P_352137765",
"datasourceConnectionInfo": {
"engineType": "POSTGRESQL",
"dataBase": "supermap",
"password": "supermap",
"user": "postgres",
"server": "192.168.120.21"
}
}
},
"analyst": {
"query": "",
"resolution": "50",
"radius": "350",
"method": "1",
"meshType": "0",
"fields": "",
"meshSizeUnit": "Meter",
"radiusUnit": "Meter",
"areaUnit": "SquareMile"
}
}
返回 rjson 格式的操作结果表述如下:
{
"newResourceID": "0dc1214e_def5_47c0_af92_b9c5172c31da",
"newResourceLocation": "http://supermapiserver:8090/iserver/services/distributedanalyst/rest/v1/jobs/spatialanalyst/density/0dc1214e_def5_47c0_af92_b9c5172c31da",
"postResultType": "CreateChild",
"succeed": true
}
对示例 densitys 资源:http://supermapiserver:8090/iserver/services/distributedanalyst/rest/v1/jobs/spatialanalyst/density.rjson 执行 POST 请求,以输入形式为数据集名称,该数据集已注册到iServer,参数中增加色带枚举值。默认输出。创建一个点密度分析任务。请求体中的参数如下:
{
"input": {
"datasetName": "samples_processing_newyorkPoint_P"
},
"analyst": {
"query": "",
"resolution": "500",
"radius": "3000",
"method": "0",
"meshType": "1",
"fields": "pickup_latitude",
"meshSizeUnit": "Meter",
"radiusUnit": "Meter",
"areaUnit": "SquareMile",
"mappingParameters": {
"rangeMode": "LOGARITHM",
"rangeCount": "10",
"colorGradientType": "GREENORANGEVIOLET"
}
}
}
返回 rjson 格式的操作结果表述如下:
{
"postResultType": "CreateChild",
"newResourceID": "2fc4d7ac_ba25_4bee_8c94_824785f667d5",
"succeed": true,
"newResourceLocation": "http:///supermapiserver:8090/iserver/services/distributedanalyst/rest/v1/jobs/spatialanalyst/density/2fc4d7ac_ba25_4bee_8c94_824785f667d5"
}
返回跟 GET 请求一样的 HTTP 响应头,但是没有响应实体。可以在不必传输整个响应内容的情况下,获取包含在响应消息头中的元数据信息。元数据信息包括媒体类型,字符编码,压缩编码,实体内容长度等。
HEAD 请求可以用来判断 density 资源是否存在,或者客户端是否有权限访问 density 资源。通过对加.<format>的 URI 执行 HEAD 请求,还可以快速判断 densitys 资源是否支持<format>格式的表述。