featureJoin


URI

<spatialanalystJobs_uri>/featurejoin[.<format>]

Supported methods

GET, POST, HEAD

Parent resource

spatialanalystJobs

Child resources

featureJoinJob

Introduction

The root directory of the feature join analysis job resource. By sending a GET request to featureJoin, you can get the list of the feature join analysis jobs of the current system. By sending a POST request, you can create a analysis task.

Supported Methods:

Supported output formats: RJSON, JSON, HTML, XML.

Resource hierarchy

HTTP request methods

Execute HTTP request on the following URI, here we take rjosn as the output format as an example. Where, supermapiserver is the server name.

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

GET request

Gets the list of feature join analysis jobs.

Response structure  

After executing a GET request on the resource, the response entity is a set of feature join resource descriptions, and the response fields of single resource are as follows:

Field Type Description
id String Application ID.
state Jobstate The status of the task. Including execution status, start time, time consuming, and so on.
setting SparkJobSetting Lists the detailed information of task configuration.

Response example

By executing a GET request on this resource, the returned response result in rjosn format is as follows:

{

    "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\\\\featurejoin\\\\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\\\\featurejoin\\\\data\\\\FeatureJoin.udb\",\"datasetNames\":[\"DLTB\"]}]}",

            "--inputJoin",

            "{\"specFields\":[\"SMID\",\"ST\",\"ET\"],\"type\":\"udb\",\"info\":[{\"server\":\"C:\\\\Users\\\\Administrator\\\\Desktop\\\\featurejoin\\\\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\\featurejoin\\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

    }

}

POST request

Creates a feature join analysis job.

Request parameter

Parameters passed in the request body should contain:

Name Type Description
input FileCSVInputDataSetting
DatasetInputDataSetting

[The following parameters are required if not specified] Supports two input ways:

1.  datasetName: dataset name. Used when the data to be analyzed is point dataset provided by the Data Catalog Service, including data imported through Data Catalog Service, registered data in iServer and point datasets stored in DataStore.

 

2. Input file path and the related information. When the data to be analyzed does not belong to Data Catalog Service, you need use this method.

      

Supported file formats: csv file, udb file, pg database. For detailed parameters' description, see: Big data analysis input parameter settings.

analyst FeatureJoinAnalystSetting [Required] Analysis settings. You need to specify:
  • inputJoin: join dataset, of which the data that meets the join condition will be joined to the target data, supports point, line and polygon
  • joinOperation: join method
      • JoinOneToOne: If there are multiple connection objects and one target object meet the join condition, these objects will be aggregated into one object according to summary fields.
      • JoinOneToMany: If there are mutilple connection objects and one target object meet the join condition, all the objects will be joined to the target object, ie., the result will contain multiple records of the target object. This mode doesn't calculate any statistics according to summary fields.
  • joinFields: join fields, which will be appended to target data. join fields are from inputJoin data, of which the value will take mode, ie., the value that appears most often, only when joinOperation is JoinOneToOne. Join fields shoud be non-system fields.
  • Spatial feature join
      • spatialRelationship: spatial join condition

          • If target data is a polygon type
              • If join data is a polygon type, supported spatial relationship: contain,disjoint, intersect, touch, near,within, overlap, identity.
              • If join data is a line type, supported spatial relationship: contain, disjoint, intersect, touch, near.
              • If join data is a point type, supported spatial relationship: contain, disjoint, intersect, touch, near.
          • If target data is a line type
              • If join data is a polygon type, supported spatial relationship: cross, disjoint, intersect, touch, within, near.
              • If join data is a line type, supported spatial relationship: contain, cross, disjoint, identity, intersect, overlap, touch, within, near.
              • If join data is a point type, supported spatial relationship: contain, disjoint, intersect, touch, near.
          • If target data is a point type
              • If join data is a polygon type, supported spatial relationship: disjoint, intersect, touch, within, near.
              • If join data is a line type, supported spatial relationship: disjoint, intersect, touch, within, near.
              • If join data is a point type, supported spatial relationship: contain, disjoint, identity, intersect, within, near.
      • spatialNearDistance: spatial distance. Valid only when then value of spatialRelationship is near.
      • spatialNearDistanceUnit: the unit of spatial distance. Valid only when then value of spatialRelationship is near. Options: meter, kilometer, yard, foot,mile. Defaults to meter.
  • Time feature join
  • Unavailable now
  • Attribute feature join
      • attributeRelationship: attribute join field. You need to specify one field from target dataset and one field from join dataset. Both of the fields should be the same type.
      • attributeMode: Only supports Equal and NotEqual.
  • inputSummaryFields: fields used for statistics, which need to be included in joinFields. If this field is not set, but joinOperation is JoinOneToOne, the number of join objects will be counted.
  • inputSummaryFieldsMode: attribute statistics mode, including: max,min, average, sum, variance, stdDeviation. The number of this field's value should be consistent with the number of inputSummaryFields's value. Optional.
  • tolerance: node tolerance, which needs to be set when using spatial relationship.
  • featureJoinNumberPrecision: Numeric precision which affects the precision of the number in labels displayed in label thematic map made according to the analysis result. Default value is 1.
output FileSystemOutputSetting
DatabaseOutputSetting

[Optional] The output of analysis result. Supported output formats: local udb file, database (pg, mongodb). For detailed parameter settings, see: Big data analysis input parameter settings.

Example 1: Input dataset name

Execute a POST request on featureJoin resource to create a feature join analysis job: http://supermapiserver:8090/iserver/services/distributedanalyst/rest/v1/jobs/spatialanalyst/featurejoin .rjson with the following request body which specifies the registered dataset name:

{

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

    }

}

then the returned resource in rjson format is as follows:

{

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

}

Example 2: Input data stored in PostgreSQL

Execute a POST request on featureJoin resource to create a feature join analysis job: http://supermapiserver:8090/iserver/services/distributedanalyst/rest/v1/jobs/spatialanalyst/featurejoin .rjson with the following request body which specifies data stored in PostgreSQL database:

{

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

    }

}

then the returned resource in rjson format is as follows:

{

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

}

HEAD request

Returns the same HTTP response header as the GET request, but no response entity, which can be used to retrieve the meta data contained in response message header without having to transmit the entire response content. Meta data information includes media type, character coding, compression coding, entity content length, etc.

HEAD request is used to determine whether the featureJoin resource exists, or if the user has the authority to access it. By executing an HEAD request with a .<format> URI, you can quickly determine whether the featureJoin resource supports the <format> representation.

See