<spatialanalystJobs_uri>/calculateodmatrix[.<format>]
OD分析资源根目录。通过对 calculateODMatrix 执行GET 请求,可获取当前系统的OD分析资作业列表。通过 POST 请求可创建一个分析任务。
支持的方法:
支持的表述格式:RJSON、JSON、HTML、XML。
对如下 URI 执行 HTTP 请求,以 rjson 输出格式为例加以说明,其中,supermapiserver 是服务器名。
http://supermapiserver:8090/iserver/services/distributedanalyst/rest/v1/jobs/spatialanalyst/calculateodmatrix.rjson
获取OD分析的作业列表。
对 calculateODMatrix 资源执行 GET 请求,在响应消息的实体主体里是一个OD分析资源描述集,其中单个资源描述的结构如下:
字段 | 类型 | 说明 |
id | String | 应用ID。 |
state | SparkJobState | 该任务的状态。包括执行状态、起止时间、耗时等。 |
setting | SparkJobSetting | 列举了任务配置的详细信息。 |
对 calculateODMatrix 资源执行 GET 请求,返回 rjson 格式的资源描述如下:
[
{
"id": "082c713b_c1b2_4b51_852d_96607b6426de",
"state": {
"errorStackTrace": null,
"endState": true,
"startTime": 1531210323465,
"endTime": 1531210382337,
"publisherelapsedTime": 3664,
"runState": "FINISHED",
"errorMsg": null,
"elapsedTime": 52694
},
"setting": {
"output": {
"outputPath": "F:\\01_package\\20180710\\supermap_iserver_910_16309_3357_win64_deploy\\webapps\\iserver\\processingResultData\\Analyst\\082c713b_c1b2_4b51_852d_96607b6426de\\calculateodmatrix.smwu",
"datasourcePath": "F:\\01_package\\20180710\\supermap_iserver_910_16309_3357_win64_deploy\\webapps\\iserver\\processingResultData\\Analyst\\082c713b_c1b2_4b51_852d_96607b6426de\\c99222f3_0dbe_4c89_a0ee_ba9d8aa26bf7.udb",
"datasetName": "analystResult",
"type": "UDB"
},
"args": null,
"input": {
"datasetName": "jasdjknasfa_airport_world_airport_10",
"numSlices": 36,
"specField": null,
"datasetInfo": {
"fieldInfos": [
{
"isRequired": true,
"defaultValue": "",
"name": "SmID",
"caption": "SmID",
"type": "INT32",
"maxLength": 4,
"isZeroLengthAllowed": true,
"isSystemField": true
},
{
"isRequired": true,
"defaultValue": "0",
"name": "SmSdriW",
"caption": "SmSdriW",
"type": "SINGLE",
"maxLength": 4,
"isZeroLengthAllowed": true,
"isSystemField": true
},
{
"isRequired": true,
"defaultValue": "0",
"name": "SmSdriN",
"caption": "SmSdriN",
"type": "SINGLE",
"maxLength": 4,
"isZeroLengthAllowed": true,
"isSystemField": true
},
{
"isRequired": true,
"defaultValue": "0",
"name": "SmSdriE",
"caption": "SmSdriE",
"type": "SINGLE",
"maxLength": 4,
"isZeroLengthAllowed": true,
"isSystemField": true
},
{
"isRequired": true,
"defaultValue": "0",
"name": "SmSdriS",
"caption": "SmSdriS",
"type": "SINGLE",
"maxLength": 4,
"isZeroLengthAllowed": true,
"isSystemField": true
},
{
"isRequired": true,
"defaultValue": "0",
"name": "SmUserID",
"caption": "SmUserID",
"type": "INT32",
"maxLength": 4,
"isZeroLengthAllowed": true,
"isSystemField": false
},
{
"isRequired": true,
"defaultValue": "0",
"name": "SmArea",
"caption": "SmArea",
"type": "DOUBLE",
"maxLength": 8,
"isZeroLengthAllowed": true,
"isSystemField": true
},
{
"isRequired": true,
"defaultValue": "0",
"name": "SmPerimeter",
"caption": "SmPerimeter",
"type": "DOUBLE",
"maxLength": 8,
"isZeroLengthAllowed": true,
"isSystemField": true
},
{
"isRequired": false,
"defaultValue": "0",
"name": "SmGeometrySize",
"caption": "SmGeometrySize",
"type": "INT32",
"maxLength": 4,
"isZeroLengthAllowed": true,
"isSystemField": true
},
{
"isRequired": true,
"defaultValue": "-1",
"name": "SmGeoPosition",
"caption": "SmGeoPosition",
"type": "INT64",
"maxLength": 8,
"isZeroLengthAllowed": true,
"isSystemField": true
},
{
"isRequired": false,
"defaultValue": "",
"name": "BufferRadiusLeft",
"caption": "BufferRadiusLeft",
"type": "DOUBLE",
"maxLength": 8,
"isZeroLengthAllowed": true,
"isSystemField": false
},
{
"isRequired": false,
"defaultValue": "",
"name": "ISO_CC",
"caption": "ISO_CC",
"type": "WTEXT",
"maxLength": 4,
"isZeroLengthAllowed": true,
"isSystemField": false
},
{
"isRequired": false,
"defaultValue": "",
"name": "NAME",
"caption": "NAME",
"type": "WTEXT",
"maxLength": 100,
"isZeroLengthAllowed": true,
"isSystemField": false
},
{
"isRequired": false,
"defaultValue": "",
"name": "ICAO",
"caption": "ICAO",
"type": "WTEXT",
"maxLength": 15,
"isZeroLengthAllowed": true,
"isSystemField": false
},
{
"isRequired": false,
"defaultValue": "",
"name": "IATA",
"caption": "IATA",
"type": "WTEXT",
"maxLength": 15,
"isZeroLengthAllowed": true,
"isSystemField": false
}
],
"epsgCode": 4326,
"datasetName": "world_airport_10",
"bounds": "Left=-177.4824915999242,Bottom=-54.93310798762423,Right=178.65367521567165,Top=78.33567866386099",
"available": true,
"name": "jasdjknasfa_airport_world_airport_10",
"readOnly": false,
"datasetType": "REGION",
"type": "UDB",
"url": "F:\\02_Data\\ODLineabcdefghij\\airport.udb"
}
},
"DEFAULT_MASTER_ADRESS": "local[*] ",
"referToken": "nWERkior5IQsS1tPlYHbw2rNOgDkYRSmMz0UowQFjG_1RKheUV6bXmpieWe9bPDy23mGKElIZB9HVFBN7YwH6w..",
"mainClass": null,
"sparkLogFile": null,
"appName": null,
"analyst": {
"regionNameField": "NAME",
"coordinateFields": [
"x_s",
"y_s",
"x_e",
"y_e"
],
"datasetOD": "jasdjknasfa_airport_flight100m_OD22",
"inputOD": "{\"type\":\"udb\",\"info\":[{\"server\":\"F:\\\\02_Data\\\\ODLineabcdefghij\\\\airport.udb\",\"datasetNames\":[\"flight100m_OD22\"]}]}",
"summaryFields": null,
"summaryStatisticModes": null
},
"contextSetting": null,
"serviceInfo": {
"targetDataPath": "F:\\01_package\\20180710\\supermap_iserver_910_16309_3357_win64_deploy\\webapps\\iserver\\processingResultData\\Analyst\\082c713b_c1b2_4b51_852d_96607b6426de\\calculateodmatrix.smwu",
"targetServiceInfos": [
{
"serviceType": "RESTMAP",
"serviceAddress": "http://192.168.120.21:8090/iserver/services/map-calculateodmatrix2/rest"
},
{
"serviceType": "RESTDATA",
"serviceAddress": "http://192.168.120.21:8090/iserver/services/data-calculateodmatrix2/rest"
}
]
},
"referServicesAddress": "http://192.168.120.21:8090/iserver"
}
}
]
创建一个OD分析任务。
对 calculateODMatrix 资源执行 POST 请求,创建一个OD分析作业任务,请求体需包含参数如下:
名称 | 类型 | 含义 |
input 【必填参数】 |
DatasetInputDataSetting |
|
analyst |
CalculateODMatrixAnalystSetting | 【以下不做特殊说明的均为必填参数】分析配置。传入时,需指定:
|
output 【选填参数】 |
FileSystemOutputSetting |
|
DatabaseOutputSetting |
|
对示例 calculateODMatrix 资源:http://supermapiserver:8090/iserver/services/distributedanalyst/rest/v1/jobs/spatialanalyst/calculateodmatrix.rjson 以输入形式为数据集名称,该数据集已注册到iServer。方式执行POST 请求,创建一个OD分析任务。请求体中的参数如下:
{
"input": {
"datasetName": "jasdjknasfa_airport_world_airport_10"
},
"analyst": {
"datasetOD": "jasdjknasfa_airport_flight100m_OD22",
"regionNameField": "NAME",
"coordinateFields": [
"x_s",
"y_s",
"x_e",
"y_e"
]
}
}
返回 rjson 格式的操作结果表述如下:
{
"postResultType": "CreateChild",
"newResourceID": "c9bc01b9_7a67_4906_8cb3_18846377fa71",
"succeed": true,
"newResourceLocation": "http://supermapiserver:8090/iserver/services/distributedanalyst/rest/v1/jobs/spatialanalyst/calculateodmatrix/c9bc01b9_7a67_4906_8cb3_18846377fa71"
}
对示例 calculateODMatrix 资源:http://supermapiserver:8090/iserver/services/distributedanalyst/rest/v1/jobs/spatialanalyst/calculateodmatrix.rjson执行POST 请求,创建一个OD分析任务,使输出结果存到mongodb中。请求体中的参数如下:
{
"input": {
"datasetName": "jasdjknasfa_airport_world_airport_10"
},
"analyst": {
"datasetOD": "jasdjknasfa_airport_flight100m_OD22",
"regionNameField": "NAME",
"coordinateFields": [
"x_s",
"y_s",
"x_e",
"y_e"
]
},
"output": {
"type": "mongodb",
"datasetName": "analystResult154693",
"datasourceInfo": {
"server": "mongodb://192.168.120.21:27017/",
"dataBase": "Overlaybase",
"engineType": "MONGODB",
"alias": "OverlayTest"
}
}
}
返回 rjson 格式的操作结果表述如下:
{
"postResultType": "CreateChild",
"newResourceID": "2804f2ca_b336_4452_b01a_5cec4827bf1a",
"succeed": true,
"newResourceLocation": "http://supermapiserver:8090/iserver/services/distributedanalyst/rest/v1/jobs/spatialanalyst/calculateodmatrix/2804f2ca_b336_4452_b01a_5cec4827bf1a"
}
返回跟 GET 请求一样的 HTTP 响应头,但是没有响应实体。可以在不必传输整个响应内容的情况下,获取包含在响应消息头中的元数据信息。元数据信息包括媒体类型,字符编码,压缩编码,实体内容长度等。
HEAD 请求可以用来判断 calculateODMatrix 资源是否存在,或者客户端是否有权限访问 odlineMake 资源。通过对加.<format>的 URI 执行 HEAD 请求,还可以快速判断 calculateODMatrix 资源是否支持<format>格式的表述。