<spatialanalystJobs_uri>/aggregatepoints[.<format>]
点聚合分析作业资源根目录。通过对 aggregatePoints 执行GET 请求,可获取当前系统的点聚合分析作业列表。通过 POST 请求可创建一个分析任务。
支持的方法:
支持的表述格式:RJSON、JSON、HTML、XML。
对如下 URI 执行 HTTP 请求,以 rjson 输出格式为例加以说明,其中,supermapiserver 是服务器名。
http://supermapiserver:8090/iserver/services/distributedanalyst/rest/v1/jobs/spatialanalyst/aggregatepoints.rjson
获取点聚合分析作业列表。
对 aggregatePoints 资源执行 GET 请求,在响应消息的实体主体里是一个点聚合分析资源描述集,其中单个资源描述的结构如下:
字段 | 类型 | 说明 |
id | String | 应用ID。 |
state | SparkJobState | 该任务的状态。包括执行状态、起止时间、耗时等。 |
setting | SparkJobSetting | 列举了任务配置的详细信息。 |
对 aggregatePoints 资源执行 GET 请求,返回 rjson 格式的资源描述如下:
{
"id": "53709374_fd76_49de_815f_4ccaf3183dde",
"setting": {
"DEFAULT_MASTER_ADRESS": "local[*] ",
"analyst": {
"fields": "col7",
"meshType": "0",
"query": "-74.050,40.650,-73.850,40.850",
"resolution": "1000",
"resultFieldNames": "max_col7",
"statisticModes": "max"
},
"appName": "summaryMesh",
"args": [
"--input",
"{\"type\":\"csv\",\"info\":[{\"server\":\"F:\\\\20170707\\\\ProcessingData\\\\newyork_taxi_2013-01_14k.csv\"}]}",
"--bounds",
"-74.050,40.650,-73.850,40.850",
"--summaryFields",
"[col7,max,max_col7]",
"--meshType",
"square",
"--meshSize",
"1000",
"--output",
"{\"server\":\"F:\\\\20170707\\\\supermap_iserver_win64_zip\\\\webapps\\\\iserver\\\\processingResultData\\\\Analyst\\\\udbs\\\\0ffb2eee-368c-45e1-99cd-7f4f47ea8215\",\"datasetName\":\"analystResult\",\"type\":\"udb\"}"
],
"contextSetting": null,
"input": {
"datasetInfo": {
"available": true,
"firstRowIsHead": false,
"name": "ProcessingData_newyork_taxi_2013-01_14k",
"separator": ",",
"type": "CSV",
"url": "F:\\20170707\\ProcessingData\\newyork_taxi_2013-01_14k.csv",
"xIndex": 10,
"yIndex": 11
},
"datasetName": "ProcessingData_newyork_taxi_2013-01_14k",
"numSlices": 0
},
"mainClass": "com.supermap.bsp.main.SummaryMeshMain",
"output": {
"datasetName": "analystResult",
"outputPath": "F:\\20170707\\supermap_iserver_win64_zip\\webapps\\iserver\\processingResultData\\Analyst\\udbs\\0ffb2eee-368c-45e1-99cd-7f4f47ea8215"
},
"serviceInfo": {
"targetDataPath": "F:\\20170707\\supermap_iserver_win64_zip\\webapps\\iserver\\processingResultData\\Analyst\\53709374_fd76_49de_815f_4ccaf3183dde",
"targetServiceInfos": [
{
"serviceAddress": "http://supermapiserver:8090/iserver/services/data-summaryMesh6/rest",
"serviceType": "RESTDATA"
},
{
"serviceAddress": "http://supermapiserver:8090/iserver/services/map-summaryMesh6/rest",
"serviceType": "RESTMAP"
}
]
},
"serviceRoot": "http://supermapiserver:8090/iserver/services/",
"type": "SUMMARYMESH"
},
"state": {
"elapsedTime": 6096,
"endState": true,
"endTime": 1499398059821,
"errorMsg": null,
"errorStackTrace": null,
"publisherelapsedTime": 2342,
"runState": "FINISHED",
"startTime": 1499398047901
}
}
创建一个点聚合分析任务。
对 aggregatePoints 资源执行 POST 请求,创建一个 点聚合分析任务,请求体需包含参数如下:
名称 | 类型 | 含义 |
input 【必填参数】 |
DatasetInputDataSetting |
|
FileCSVInputDataSetting |
|
|
analyst |
SummaryMeshAnalystSetting(格网聚合分析设置) | 【必填参数】格网聚合分析配置。传入时,需指定:
|
SummaryRegionAnalystSetting(多边形聚合分析设置) | 【必填参数】多边形聚合分析配置。传入时需指定:
|
|
type |
SummaryAnalystType | 【必填参数】点聚合分析类型。包含:SummaryMesh(格网聚合)、SummaryRegion (多边形聚合) |
output 【选填参数】 |
FileSystemOutputSetting |
|
DatabaseOutputSetting |
|
对示例 aggregatePoints 资源:http://supermapiserver:8090/iserver/services/distributedanalyst/rest/v1/jobs/spatialanalyst/aggregatepoints.rjson 以输入形式为数据集名称,该数据集已注册到iServer,输出为自定义到本地的udb文件。方式执行POST 请求,创建一个点聚合分析任务。请求体中的参数如下:
{
"input": {
"datasetName": "samples_newyork_taxi_2013-01_14k"
},
"analyst": {
"fields": "col7,col8",
"statisticModes": "min,max",
"mappingParameters": {
"numericPrecision": 1
},
"query": "-74.050,40.650,-73.850,40.850",
"resolution": "100",
"meshType": "0",
"meshSizeUnit": "Meter"
},
"type": "SUMMARYMESH",
"output": {
"outputPath": "F:\\20180411\\aggregatepoints.smwu",
"datasourcePath": "F:\\20180411\\aggregatepoints.udb",
"type": "udb"
}
}
返回 rjson 格式的操作结果表述如下:
{
"newResourceID": "096ab70e_bdfb_4f83_8965_5e7f90a7a5ec",
"newResourceLocation":"http://supermapiserver:8090/iserver/services/distributedanalyst/rest/v1/jobs/spatialanalyst/aggregatepoints/096ab70e_bdfb_4f83_8965_5e7f90a7a5ec",
"postResultType": "CreateChild",
"succeed": true
}
对示例 aggregatePoints 资源:http://supermapiserver:8090/iserver/services/distributedanalyst/rest/v1/jobs/spatialanalyst/aggregatepoints.rjson 执行 POST 请求,以输入未注册到 iServer 的csv文件路径的方式,创建一个点聚合分析任务,结果数据源输出到pg数据库。请求体中的参数如下:
{
"input": {
"filePath": "F:\\20170629\\ProcessingData\\newyork_taxi_2013-01_14k.csv"
},
"analyst": {
"fields": "",
"statisticModes": "",
"query": "",
"resolution": "0.001",
"meshType": "0"
},
"type": "SUMMARYMESH",
"output": {
"type": "pg",
"outputPath": "F:\\20171018\\SUMMARYMESH.smwu",
"datasetName": "resultany",
"datasourceInfo": {
"server": "192.168.120.46",
"alias": "supermap1_pg",
"dataBase": "supermap1",
"user": "postgres",
"engineType": "POSTGRESQL",
"password": "supermap"
}
}
}
返回 rjson 格式的操作结果表述如下:
{
"newResourceID": "edab41bf_e491_4a02_b439_04ad368ebe29",
"newResourceLocation":"http://supermapiserver:8090/iserver/services/distributedanalyst/rest/v1/jobs/spatialanalyst/aggregatepoints/edab41bf_e491_4a02_b439_04ad368ebe29",
"postResultType": "CreateChild",
"succeed": true
}
对示例 aggregatePoints 资源:http://supermapiserver:8090/iserver/services/distributedanalyst/rest/v1/jobs/spatialanalyst/aggregatepoints.rjson 执行 POST 请求,连接外部的 PostgreSQL 数据库,即未注册到iServer 的数据库中存储的数据。 创建一个点聚合分析任务。请求体中的参数如下:
{
"input": {
"datasetInfo": {
"type": "POINT",
"name": "newyorkPoint_P_2142356139",
"datasourceConnectionInfo": {
"engineType": "POSTGRESQL",
"dataBase": "supermap",
"password": "supermap",
"user": "postgres",
"server": "192.168.120.46"
}
}
},
"analyst": {
"regionDatasource": "{\"type\":\"pg\",\"info\":[{\"server\":\"192.168.120.46\",\"datasetNames\":[\"newyorkZone_R_2142356139\"],\"database\":\"supermap\",\"user\":\"postgres\",\"password\":\"supermap\"}]}",
"fields":"PASSENGER_COUNT",
"statisticModes": "sum"
},
"type": "SUMMARYREGION"
}
返回 rjson 格式的操作结果表述如下:
{
"newResourceID": "0ce3a547_1e0d_43fa_908c_5410532e9e9d",
"newResourceLocation": "http://supermapiserver:8090/iserver/services/distributedanalyst/rest/v1/jobs/spatialanalyst/aggregatepoints/0ce3a547_1e0d_43fa_908c_5410532e9e9d",
"postResultType": "CreateChild",
"succeed": true
}
对示例 aggregatePoints 资源:http://supermapiserver:8090/iserver/services/distributedanalyst/rest/v1/jobs/spatialanalyst/aggregatepoints.rjson 执行 POST 请求,以输入形式为数据集名称,该数据集已注册到iServer,参数中增加色带枚举值。默认输出。创建一个点聚合分析任务。请求体中的参数如下:
{
"input": {
"datasetName": "samples_processing_newyorkPoint_P"
},
"analyst": {
"fields": "pickup_latitude",
"statisticModes": "min",
"mappingParameters": {
"numericPrecision": 5,
"rangeMode": "EQUALINTERVAL",
"rangeCount": "4",
"colorGradientType": "RAINBOW"
},
"query": "",
"resolution": "10",
"meshType": "1",
"meshSizeUnit": "Kilometer"
},
"type": "SUMMARYMESH"
}
返回 rjson 格式的操作结果表述如下:
{
"postResultType": "CreateChild",
"newResourceID": "1ab6c3dc_c783_48e9_ab91_c8944d08d71d",
"succeed": true,
"newResourceLocation": "http://supermapiserver:8090/iserver/services/distributedanalyst/rest/v1/jobs/spatialanalyst/aggregatepoints/1ab6c3dc_c783_48e9_ab91_c8944d08d71d"
}
返回跟 GET 请求一样的 HTTP 响应头,但是没有响应实体。可以在不必传输整个响应内容的情况下,获取包含在响应消息头中的元数据信息。元数据信息包括媒体类型,字符编码,压缩编码,实体内容长度等。
HEAD 请求可以用来判断 aggregatePoints 资源是否存在,或者客户端是否有权限访问 aggregatePoints 资源。通过对加.<format>的 URI 执行 HEAD 请求,还可以快速判断 aggregatePoints 资源是否支持<format>格式的表述。