<spatialanalystJobs_uri>/reconstructtracks[.<format>]
轨迹重建资源根目录。通过对 reconstructTracks 执行GET 请求,可获取当前系统的轨迹重建作业列表。通过 POST 请求可创建一个分析任务。
支持的方法:
支持的表述格式:RJSON、JSON、HTML、XML。
对如下 URI 执行 HTTP 请求,以 rjson 输出格式为例加以说明,其中,supermapiserver 是服务器名。
http://supermapiserver:8090/iserver/services/distributedanalyst/rest/v1/jobs/spatialanalyst/reconstructtracks.rjson
获取轨迹重建作业列表
对 reconstructTracks 资源执行 GET 请求,在响应消息的实体主体里是一个轨迹重建资源描述集,其中单个资源描述的结构如下:
名称 | 类型 | 含义 |
id | String | 应用ID。 |
state | SparkJobState | 该任务的状态。包括执行状态、起止时间、耗时等。 |
setting | SparkJobSetting | 列举了任务配置的详细信息。 |
对 reconstructTracks 资源执行 GET 请求,返回 rjson 格式的资源描述如下:
[
{
"id": "ed4dbcda_0ab1_47bf_a036_42023c7cb09d",
"state": {
"errorStackTrace": null,
"endState": true,
"startTime": 1524896605343,
"endTime": 1524896642411,
"publisherelapsedTime": 35445,
"runState": "FINISHED",
"errorMsg": null,
"elapsedTime": 0
},
"setting": {
"output": {
"outputPath": null,
"featureRDD": {
"org$apache$spark$rdd$RDD$$evidence$1": {}
},
"datasetName": "analystResult",
"buildPyramid": false,
"type": "RDD"
},
"args": null,
"input": {
"datasetName": "samples_processing_reconstructTracks_P",
"numSlices": 36,
"specField": "GPSTIME",
"datasetInfo": {
"fieldInfos": [
{
"isRequired": true,
"defaultValue": "",
"name": "SmID",
"caption": "SmID",
"type": "INT32",
"maxLength": 4,
"isZeroLengthAllowed": true,
"isSystemField": true
},
{
"isRequired": true,
"defaultValue": "0",
"name": "SmX",
"caption": "SmX",
"type": "DOUBLE",
"maxLength": 8,
"isZeroLengthAllowed": true,
"isSystemField": true
},
{
"isRequired": true,
"defaultValue": "0",
"name": "SmY",
"caption": "SmY",
"type": "DOUBLE",
"maxLength": 8,
"isZeroLengthAllowed": true,
"isSystemField": true
},
{
"isRequired": false,
"defaultValue": "1",
"name": "SmLibTileID",
"caption": "SmLibTileID",
"type": "INT32",
"maxLength": 4,
"isZeroLengthAllowed": true,
"isSystemField": true
},
{
"isRequired": true,
"defaultValue": "0",
"name": "SmUserID",
"caption": "SmUserID",
"type": "INT32",
"maxLength": 4,
"isZeroLengthAllowed": true,
"isSystemField": false
},
{
"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": "ISSI",
"caption": "ISSI",
"type": "WTEXT",
"maxLength": 18,
"isZeroLengthAllowed": true,
"isSystemField": false
},
{
"isRequired": false,
"defaultValue": "",
"name": "X",
"caption": "X",
"type": "WTEXT",
"maxLength": 22,
"isZeroLengthAllowed": true,
"isSystemField": false
},
{
"isRequired": false,
"defaultValue": "",
"name": "Y",
"caption": "Y",
"type": "WTEXT",
"maxLength": 21,
"isZeroLengthAllowed": true,
"isSystemField": false
},
{
"isRequired": false,
"defaultValue": "",
"name": "GPSTIME",
"caption": "GPSTIME",
"type": "DATETIME",
"maxLength": 8,
"isZeroLengthAllowed": true,
"isSystemField": false
}
],
"epsgCode": 4326,
"datasetName": "reconstructTracks_P",
"bounds": "Left=111.52128333,Bottom=22.14568019,Right=114.70129967,Top=23.50906849",
"available": true,
"name": "samples_processing_reconstructTracks_P",
"readOnly": false,
"datasetType": "POINT",
"type": "UDB",
"url": "F:\\01_package\\20180428\\ProcessingData\\processing.udb"
}
},
"DEFAULT_MASTER_ADRESS": "local[*] ",
"referToken": "nqEk7hOen-7NBidP7O2sqAvQTeRHUYgswUyUaNT-sV72ePCYqPkYWZlT2ZjrTa2J9UiyKK2znkEbXkwgUV-PoQ..",
"mainClass": null,
"sparkLogFile": null,
"appName": null,
"analyst": {
"timeSplitUnit": "DAY",
"trackFields": [
"ISSI"
],
"timeSplit": 2,
"summaryFields": [
""
],
"summaryStatisticModes": null
},
"contextSetting": null,
"serviceInfo": {
"targetDataPath": null,
"targetServiceInfos": [
{
"serviceType": "RESTMAP",
"serviceAddress": "http://supermapiserver:8090/iserver/services/distributedanalyst/rest/v1/jobs/spatialanalyst/reconstructtracks/ed4dbcda_0ab1_47bf_a036_42023c7cb09d"
}
]
},
"referServicesAddress": "http://supermapiserver:8090/iserver"
}
}
]
创建一个轨迹重建任务。
对 reconstructTracks 资源执行 POST 请求,创建一个 轨迹重建作业任务,请求体需包含参数如下:
名称 | 类型 | 含义 |
input 【必填参数】 |
DatasetInputDataSetting |
|
FileCSVInputDataSetting |
|
|
analyst |
ReconstructTracksAnalystSetting | 【以下不做特殊说明的均为必填参数】分析配置。传入时,需指定:
|
output 【选填参数】 |
FileSystemOutputSetting |
|
DatabaseOutputSetting |
|
对示例 reconstructTracks 资源:http://supermapiserver:8090/iserver/services/distributedanalyst/rest/v1/jobs/spatialanalyst/reconstructtracks .rjson 以输入形式为数据集名称,该数据集已注册到iServer。方式执行POST 请求,创建一个轨迹重建任务。请求体中的参数如下:
{
"input": {
"datasetName": "samples_processing_reconstructTracks_P",
"specField": "GPSTIME"
},
"analyst": {
"trackFields": [
"ISSI"
],
"timeSplit": "2",
"timeSplitUnit": "DAY",
"summaryFields": [
"ISSI"
],
"summaryStatisticModes": "MIN"
}
}
返回 rjson 格式的操作结果表述如下:
"postResultType": "CreateChild",
"newResourceID": "3c5de7bb_999c_4d24_88f8_64b97b83621a",
"succeed": true,
"newResourceLocation": "http://supermapiserver:8090/iserver/services/distributedanalyst/rest/v1/jobs/spatialanalyst/reconstructtracks/3c5de7bb_999c_4d24_88f8_64b97b83621a"
}
对示例 reconstructTracks 资源:http://supermapiserver:8090/iserver/services/distributedanalyst/rest/v1/jobs/spatialanalyst/reconstructtracks.rjson 执行 POST 请求,输入数据为存储于PostgreSQL 数据库的数据。 创建一个轨迹重建任务。请求体中的参数如下:
{
"input": {
"datasetInfo": {
"type": "POINT",
"name": "reconstructTracks_P_69289212",
"datasourceConnectionInfo": {
"engineType": "POSTGRESQL",
"dataBase": "supermap",
"password": "supermap",
"user": "postgres",
"server": "192.168.120.21"
}
},
"specField": "GPSTIME"
},
"analyst": {
"trackFields": [
"ISSI"
],
"timeSplit": "2",
"timeSplitUnit": "DAY",
"summaryFields": [
"ISSI"
],
"summaryStatisticModes": [
"MIN"
]
}
}
返回 rjson 格式的操作结果表述如下:
{
"postResultType": "CreateChild",
"newResourceID": "f80271cf_3697_4560_a863_1f68e199d675",
"succeed": true,
"newResourceLocation": "http://supermapiserver:8090/iserver/services/distributedanalyst/rest/v1/jobs/spatialanalyst/reconstructtracks/f80271cf_3697_4560_a863_1f68e199d675"
}
对示例 reconstructtracks资源:http://supermapiserver:8090/iserver/services/distributedanalyst/rest/v1/jobs/spatialanalyst/reconstructtracks.rjson 执行POST 请求,创建一个轨迹重建任务。请求体如下:
{
"input": {
"datasetName": "samples_processing_reconstructTracks_P",
"specField": "GPSTIME"
},
"analyst": {
"trackFields": [
"ISSI"
],
"timeSplit": "2",
"timeSplitUnit": "DAY"
},
"output": {
"type": "HBASE",
"datasetName": "resultany34",
"datasourceInfo": {
"dataBase": "iserver005",
"engineType": "HBASE",
"server": "192.168.120.21:2181"
}
}
}
返回 rjson 格式的操作结果表述如下:
{
"postResultType": "CreateChild",
"newResourceID": "dbf4f670_8b60_4120_9993_f15cbccb4cc0",
"succeed": true,
"newResourceLocation": "http://supermapiserver:8090/iserver/services/distributedanalyst/rest/v1/jobs/spatialanalyst/reconstructtracks/dbf4f670_8b60_4120_9993_f15cbccb4cc0"
}
返回跟 GET 请求一样的 HTTP 响应头,但是没有响应实体。可以在不必传输整个响应内容的情况下,获取包含在响应消息头中的元数据信息。元数据信息包括媒体类型,字符编码,压缩编码,实体内容长度等。
HEAD 请求可以用来判断 reconstructtracks 资源是否存在,或者客户端是否有权限访问 reconstructtracks 资源。通过对加.<format>的 URI 执行 HEAD 请求,还可以快速判断 reconstructtracks 资源是否支持<format>格式的表述。