reconstructTracks


URI

<spatialanalystJobs_uri>/reconstructtracks[.<format>]

支持的方法

GETPOSTHEAD

父资源

spatialanalystJobs

子资源

reconstructTracksJob

介绍

轨迹重建资源根目录。通过对 reconstructTracks 执行GET 请求,可获取当前系统的轨迹重建作业列表。通过 POST 请求可创建一个分析任务。

支持的方法:

支持的表述格式:RJSON、JSON、HTML、XML。

资源层次

HTTP 请求方法

对如下 URI 执行 HTTP 请求,以 rjson 输出格式为例加以说明,其中,supermapiserver 是服务器名。

http://supermapiserver:8090/iserver/services/distributedanalyst/rest/v1/jobs/spatialanalyst/reconstructtracks.rjson

GET 请求

获取轨迹重建作业列表

响应结构

对 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"

        }

    }

]

POST 请求

创建一个轨迹重建任务。

请求参数

对 reconstructTracks 资源执行 POST 请求,创建一个 轨迹重建作业任务,请求体需包含参数如下:

名称 类型 含义

input

【必填参数】

DatasetInputDataSetting
  • 数据集输入设置,当输入数据是一个数据目录服务中已存在的数据集时,用该设置。其中包含如下字段
    • datasetName:数据集名称。其中数据集的来源包括通过数据目录服务导入的数据、注册到 iServer 的数据对应的数据集以及 DataStore 中存储的数据集。
    • specField: 源数据集时间属性字段。
  • 数据集信息输入设置,当输入数据集文件路径及信息时,用该设置。其中包含如下字段
    • datasetInfo:数据集信息。其中数据集的来源包括:csv文件、udb文件、空间数据库。详细参数说明请参考:大数据分析输入参数设定
    • specField: 源数据集时间属性字段。
 FileCSVInputDataSetting
  • 文件路径输入设置。 当输入数据集文件路径时,用该设置。其中包含如下字段。
    • filePath:文件所在路径。其中路径包括:csv文件路径、hdfs文件路径。 详细参数说明请参考:大数据分析输入参数设定
    • metaInfo:数据文件的元信息。若该数据存放目录下包含 .meta 文件,则此参数可不填。

analyst

ReconstructTracksAnalystSetting 【以下不做特殊说明的均为必填参数】分析配置。传入时,需指定:
  • trackField:轨迹ID字段。该字段用来区别轨迹,可以支持多字段,使用逗号","分隔
  • timeSplit:时间间隔  用来分割轨迹的时间段。超过这个时间间隔将分裂成一个新的轨迹。
  • timeSplitUnit:时间间隔单位 ,可选值: milliSeconds | seconds | minutes | hours | days | weeks | months | years。默认值为seconds。
  • summaryFields:属性统计字段。统计字段个数应该和统计模式的个数保持一致。 仅支持系统字段以外的整形、长整形、浮点型的字段的名称。【选填参数】
  • summaryStatisticModes:属性统计模式。支持统计类型有MAX,MIN,SUM,RECORDCOUNT,AVERAGE,VARIANCE,STDDEVIATION。【选填参数】

output

【选填参数】

FileSystemOutputSetting
  • 分析结果输出设置。当输出结果到文件时。用该设置。其中包含如下字段
    • type:指定输出类型。
    • datasourcePath :结果数据源的存放路径。其中分析结果可以存放到udb或hdfs中。
    • outputPath:分析结果工作空间输出路径。
DatabaseOutputSetting
  • 分析结果输出设置。当输出结果到数据库(PostgreSQL、PostGIS、MongoDB)时。用该设置。其中包含如下字段
    • type:指定输出类型。
    • datasetName:分析结果数据集名称。
    • datasourceInfo:结果数据源的连接信息。详细参数设定请参考:大数据分析输出参数设定

示例1:输入数据集名称

对示例 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"

}

示例2:输入 PostgreSQL 中存储的数据

对示例 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"

}

 

示例3:输出结果数据集存放在HBASE中

对示例 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"

}

HEAD 请求

返回跟 GET 请求一样的 HTTP 响应头,但是没有响应实体。可以在不必传输整个响应内容的情况下,获取包含在响应消息头中的元数据信息。元数据信息包括媒体类型,字符编码,压缩编码,实体内容长度等。

HEAD 请求可以用来判断 reconstructtracks 资源是否存在,或者客户端是否有权限访问 reconstructtracks 资源。通过对加.<format>的 URI 执行 HEAD 请求,还可以快速判断 reconstructtracks 资源是否支持<format>格式的表述。

请参见