<spatialanalystJobs_uri>/featurejoin[.<format>]
要素连接作业资源根目录。通过对 featureJoin 执行GET 请求,可获取当前系统的要素连接作业列表。通过 POST 请求可创建一个要素连接任务。
支持的方法:
支持的表述格式:RJSON、JSON、HTML、XML。
对如下 URI 执行 HTTP 请求,以 rjson 输出格式为例加以说明,其中,supermapiserver 是服务器名。
http://supermapiserver:8090/iserver/services/distributedanalyst/rest/v1/jobs/spatialanalyst/featurejoin.rjson
获取要素连接作业列表。
对 featureJoin 资源执行 GET 请求,在响应消息的实体主体里是一个要素连接资源描述集,其中单个资源描述的结构如下:
字段 | 类型 | 说明 |
id | String | 应用ID。 |
state | SparkJobState | 该任务的状态。包括执行状态、起止时间、耗时等。 |
setting | SparkJobSetting | 列举了任务配置的详细信息。 |
对 featureJoin 资源执行 GET 请求,返回 rjson 格式的资源描述如下:
{
"id": "600b8484_92ac_49df_89c9_6557c2113a2b",
"setting": {
"DEFAULT_MASTER_ADRESS": "local[*] ",
"analyst": {
"attributeMode": "NotEqual",
"attributeRelationship": "BSM",
"datasetFeatureJoin": "smtiles_FeatureJoin_XZQ",
"inputJoin": "{\"specFields\":[\"SMID\",\"ST\",\"ET\"],\"type\":\"udb\",\"info\":[{\"server\":\"C:\\\\Users\\\\Administrator\\\\Desktop\\\\要素连接\\\\data\\\\FeatureJoin.udb\",\"datasetNames\":[\"XZQ\"]}]}",
"joinFields": "KZMJ",
"joinOperation": "JoinOneToMany",
"resultFieldNames": null,
"spatialNearDistance": "1",
"spatialNearDistanceUnit": "kilometer",
"spatialRelationship": "near",
"specFields": "SMID,ST,ET",
"summaryFields": null,
"summaryMode": null,
"temporalNearDistance": "1",
"temporalNearDistanceUnit": "hour",
"temporalRelationship": "near"
},
"appName": "featureJoinAnalyst",
"args": [
"--inputTarget",
"{\"sliceNum\":20,\"specFields\":[\"SMID\",\"ST\",\"ET\"],\"type\":\"udb\",\"info\":[{\"server\":\"C:\\\\Users\\\\Administrator\\\\Desktop\\\\要素连接\\\\data\\\\FeatureJoin.udb\",\"datasetNames\":[\"DLTB\"]}]}",
"--inputJoin",
"{\"specFields\":[\"SMID\",\"ST\",\"ET\"],\"type\":\"udb\",\"info\":[{\"server\":\"C:\\\\Users\\\\Administrator\\\\Desktop\\\\要素连接\\\\data\\\\FeatureJoin.udb\",\"datasetNames\":[\"XZQ\"]}]}",
"--joinOperation",
"JoinOneToMany",
"--joinFields",
"KZMJ",
"--spatialRelationship",
"near",
"--spatialNearDistance",
"1",
"--spatialNearDistanceUnit",
"kilometer",
"--temporalRelationship",
"near",
"--temporalNearDistance",
"1",
"--temporalNearDistanceUnit",
"hour",
"--attributeRelationship",
"[BSM,NotEqual]",
"--output",
"{\"server\":\"192.168.120.21\",\"password\":\"supermap\",\"database\":\"supermap\",\"datasetName\":\"analystResult_635774468\",\"blockingWrite\":null,\"type\":\"pg\",\"user\":\"postgres\"}"
],
"contextSetting": null,
"input": {
"datasetInfo": {
"available": true,
"bounds": "Left=3.8385244968896E7,Bottom=3943626.398848,Right=3.8390388268116E7,Top=3946482.966666",
"datasetName": "DLTB",
"datasetType": "REGION",
"epsgCode": 2362,
"name": "smtiles_FeatureJoin_DLTB",
"readOnly": false,
"type": "UDB",
"url": "C:\\Users\\Administrator\\Desktop\\要素连接\\data\\FeatureJoin.udb"
},
"datasetName": "smtiles_FeatureJoin_DLTB",
"numSlices": 0,
"specField": "SMID,ST,ET"
},
"mainClass": "com.supermap.bdt.main.FeatureJoinMain",
"output": {
"datasetName": "analystResult_635774468",
"datasourceInfo": {
"alias": "supermap_pg",
"connect": true,
"dataBase": "supermap",
"driver": "PostgreSQL ANSI",
"engineType": "POSTGRESQL",
"exclusive": false,
"openLinkTable": false,
"password": "supermap",
"readOnly": false,
"server": "192.168.120.21",
"user": "postgres"
},
"outputPath": "F:\\1.package\\20171025\\supermap_iserver_901_15425_4681_win64_zip\\webapps\\iserver\\processingResultData\\Analyst\\600b8484_92ac_49df_89c9_6557c2113a2b\\featureJoinAnalyst.smwu",
"type": "pg"
},
"serviceInfo": {
"targetDataPath": "F:\\1.package\\20171025\\supermap_iserver_901_15425_4681_win64_zip\\webapps\\iserver\\processingResultData\\Analyst\\600b8484_92ac_49df_89c9_6557c2113a2b\\featureJoinAnalyst.smwu",
"targetServiceInfos": [
{
"serviceAddress": "http://supermapiserver:8090/iserver/services/map-featureJoinAnalyst13/rest",
"serviceType": "RESTMAP"
},
{
"serviceAddress": "http://supermapiserver:8090/iserver/services/data-featureJoinAnalyst13/rest",
"serviceType": "RESTDATA"
}
]
},
"serviceRoot": "http://supermapiserver:8090/iserver/services/",
"sparkLogFile": null
},
"state": {
"elapsedTime": 18188,
"endState": true,
"endTime": 1509007481687,
"errorMsg": null,
"errorStackTrace": null,
"publisherelapsedTime": 2840,
"runState": "FINISHED",
"startTime": 1509007454998
}
}
创建一个要素连接任务。
对 featureJoin 资源执行 POST 请求,创建一个 要素连接任务,请求体需包含参数如下:
名称 | 类型 | 含义 |
input 【必填参数】 |
DatasetInputDataSetting |
|
FileCSVInputDataSetting |
|
|
analyst |
FeatureJoinAnalystSetting | 【必填参数】分析配置。传入时,需指定:
|
output 【选填参数】 |
FileSystemOutputSetting |
|
DatabaseOutputSetting |
|
对示例 featureJoin 资源:http://supermapiserver:8090/iserver/services/distributedanalyst/rest/v1/jobs/spatialanalyst/featurejoin.json 以输入形式为数据集名称,该数据集已注册到iServer。方式执行POST 请求,创建一个要素连接任务。请求体中的参数如下:
{
"input": {
"datasetName": "smtiles_FeatureJoin_DLTB"
},
"analyst": {
"datasetFeatureJoin": "smtiles_FeatureJoin_XZQ",
"joinOperation": "JOINONETOONE",
"joinFields": "KZMJ",
"mappingParameters": {
"numericPrecision": 2
},
"spatialRelationship": "NEAR",
"spatialNearDistance": "1",
"spatialNearDistanceUnit": "KILOMETER",
"tolerance": "0.0001",
"summaryFields": "KZMJ",
"summaryMode": "max"
}
}
返回 rjson 格式的操作结果表述如下:
{
"postResultType": "CreateChild",
"newResourceID": "a39624cf_9a74_484f_a334_c1da1ae71811",
"succeed": true,
"newResourceLocation": "http://supermapiserver:8090/iserver/services/distributedanalyst/rest/v1/jobs/spatialanalyst/featurejoin/a39624cf_9a74_484f_a334_c1da1ae71811"
}
对示例 featureJoin 资源:http://supermapiserver:8090/iserver/services/distributedanalyst/rest/v1/jobs/spatialanalyst/featurejoin.json 执行 POST 请求,输入数据为存储于PostgreSQL 数据库的数据。 创建一个要素连接任务。请求体中的参数如下:
{
"input": {
"datasetName": "DLTB_522316171",
"datasourceConnectionInfo": {
"engineType": "POSTGRESQL",
"dataBase": "supermap",
"password": "supermap",
"user": "postgres",
"server": "192.168.120.21"
}
},
"analyst": {
"datasetFeatureJoin": "XZQ_522316171",
"joinOperation": "JOINONETOONE",
"joinFields": "KZMJ",
"mappingParameters": {
"numericPrecision": null
},
"spatialRelationship": "NEAR",
"spatialNearDistanceUnit": "KILOMETER"
}
}
返回 rjson 格式的操作结果表述如下:
{
"postResultType": "CreateChild",
"newResourceID": "8a532ad1_45df_4ea6_8a66_e79553117f42",
"succeed": true,
"newResourceLocation": "http://supermapiserver:8090/iserver/services/distributedanalyst/rest/v1/jobs/spatialanalyst/featurejoin/8a532ad1_45df_4ea6_8a66_e79553117f42"
}
对示例 featureJoin 资源:http://supermapiserver:8090/iserver/services/distributedanalyst/rest/v1/jobs/spatialanalyst/featurejoin.json 以输入形式为数据集名称,该数据集已注册到iServer,参数中增加色带枚举值。默认输出。方式执行POST 请求,创建一个要素连接任务。请求体中的参数如下 :
{
"input": {
"datasetName": "feature_FeatureJoin_DLTB"
},
"analyst": {
"datasetFeatureJoin": "feature_FeatureJoin_XZQ",
"joinOperation": "JOINONETOONE",
"joinFields": "BSM",
"mappingParameters": {
"numericPrecision": 4,
"rangeMode": "SQUAREROOT",
"rangeCount": "5",
"colorGradientType": "GREENORANGERED"
},
"spatialRelationship": "NEAR",
"spatialNearDistance": "1",
"spatialNearDistanceUnit": "KILOMETER",
"tolerance": "0.0001",
"summaryFields": "BSM",
"summaryMode": "min"
}
}
返回 rjson 格式的操作结果表述如下:
{
"postResultType": "CreateChild",
"newResourceID": "bfb7661e_6160_4a98_aef8_d76f7193a6f8",
"succeed": true,
"newResourceLocation": "http://supermapiserver:8090/iserver/services/distributedanalyst/rest/v1/jobs/spatialanalyst/featurejoin/bfb7661e_6160_4a98_aef8_d76f7193a6f8"
}
返回跟 GET 请求一样的 HTTP 响应头,但是没有响应实体。可以在不必传输整个响应内容的情况下,获取包含在响应消息头中的元数据信息。元数据信息包括媒体类型,字符编码,压缩编码,实体内容长度等。
HEAD 请求可以用来判断 featureJoin 资源是否存在,或者客户端是否有权限访问 featureJoin 资源。通过对加.<format>的 URI 执行 HEAD 请求,还可以快速判断 featureJoin 资源是否支持<format>格式的表述。