topologyValidator


URI

<spatialanalystJobs_uri>/topologyvalidator[.<format>]

Supported methods

GET, POST, HEAD

Parent resource

spatialanalystJobs

Child resources

topologyValidatorJob

Introduction

The root directory of the topology validation analysis job resource. By sending a GET request to topologyValidator, you can get the list of the topology validation 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/topologyvalidator.rjson

GET request

Gets the list of topology validation analysis jobs.

Response structure  

After executing a GET request on the resource, the response entity is a set of topology validation 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": "64e3f1e9_8e4f_42b5_9f98_af204be77880",

  "setting": {

    "DEFAULT_MASTER_ADRESS": "local[*] ",

    "analyst": {

      "datasetTopology": "smtiles_Jingjin_New_Region_1",

      "inputValidating": "{\"type\":\"udb\",\"info\":[{\"server\":\"F:\\\\4.datastore\\\\Data\\\\data\\\\City - bak - bak\\\\Jingjin.udb\",\"datasetNames\":[\"New_Region_1\"]}]}",

      "rule": "RegionContainedByRegion",

      "tolerance": ""

    },

    "appName": "topologyValidator",

    "args": [

      "--inputSource",

      "{\"sliceNum\":20,\"type\":\"udb\",\"info\":[{\"server\":\"F:\\\\4.datastore\\\\Data\\\\data\\\\City - bak - bak\\\\Jingjin.udb\",\"datasetNames\":[\"New_Region\"]}]}",

      "--inputValidating",

      "{\"type\":\"udb\",\"info\":[{\"server\":\"F:\\\\4.datastore\\\\Data\\\\data\\\\City - bak - bak\\\\Jingjin.udb\",\"datasetNames\":[\"New_Region_1\"]}]}",

      "--rule",

      "RegionContainedByRegion",

      "--output",

      "{\"server\":\"192.168.120.21\",\"password\":\"supermap\",\"database\":\"supermap1\",\"datasetName\":\"analystResult_1597348849\",\"blockingWrite\":null,\"type\":\"pg\",\"user\":\"postgres\"}"

    ],

    "contextSetting": null,

    "input": {

      "datasetInfo": {

        "available": true,

        "bounds": "Left=-97.1879129784341,Bottom=38.379098407748195,Right=749.938641932885,Top=433.65169599572",

        "datasetName": "New_Region",

        "datasetType": "REGION",

        "epsgCode": -1000,

        "name": "smtiles_Jingjin_New_Region",

        "readOnly": false,

        "type": "UDB",

        "url": "F:\\4.datastore\\Data\\data\\City - bak - bak\\Jingjin.udb"

      },

      "datasetName": "smtiles_Jingjin_New_Region",

      "numSlices": 0,

      "specField": null

    },

    "mainClass": "com.supermap.bdt.main.TopologyValidatorMain",

    "output": {

      "datasetName": "analystResult_1597348849",

      "datasourceInfo": {

        "alias": "supermap1_pg",

        "connect": true,

        "dataBase": "supermap1",

        "driver": "PostgreSQL ANSI",

        "engineType": "POSTGRESQL",

        "exclusive": false,

        "openLinkTable": false,

        "password": "supermap",

        "readOnly": false,

        "server": "192.168.120.21",

        "user": "postgres"

      },

      "outputPath": "F:\\1.package\\20171021\\supermap_iserver_901_15420_4680_win64_zip\\webapps\\iserver\\processingResultData\\Analyst\\64e3f1e9_8e4f_42b5_9f98_af204be77880\\topology.smwu",

      "type": "pg"

    },

    "serviceInfo": {

      "targetDataPath": "F:\\1.package\\20171021\\supermap_iserver_901_15420_4680_win64_zip\\webapps\\iserver\\processingResultData\\Analyst\\64e3f1e9_8e4f_42b5_9f98_af204be77880\\topology.smwu",

      "targetServiceInfos": [

        {

          "serviceAddress": "http://supermapiserver:8090/iserver/services/map-topology22/rest",

          "serviceType": "RESTMAP"

        },

        {

          "serviceAddress": "http://supermapiserver:8090/iserver/services/data-topology22/rest",

          "serviceType": "RESTDATA"

        }

      ]

    },

    "serviceRoot": "http://supermapiserver:8090/iserver/services/",

    "sparkLogFile": null

  },

  "state": {

    "elapsedTime": 12651,

    "endState": true,

    "endTime": 1508833694778,

    "errorMsg": null,

    "errorStackTrace": null,

    "publisherelapsedTime": 8446,

    "runState": "FINISHED",

    "startTime": 1508833669915

  }

}

POST request

Creates a task of topology validation analysis job.

Request parameter

Parameters passed in the request body should contain:

Name Type Description
input FileCSVInputDataSetting
DatasetInputDataSetting

[Required] Supports two input ways:

 1. datasetName: dataset name. Used when the data to be analyzed in the Data Catalog Service is point type, 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, index file stored in hdfs. For detailed parameters' description, see: Big data analysis input parameter settings.
analyst TopologyValidatorAnalystSetting [Required] Analysis settings. You need to specify:
  • datasetTopology: Topology validator dataset, which is invalid when the topology rule doesn't need a reference dataset.
  • rule: Topology rule (the wrong parts that don't meet the rule will be displayed)
    • REGIONNOOVERLAP: Checks if the interior of polygons not overlap with the interior of polygons in the same given region dataset. The overlapped region objects are incorrect.
    • REGIONNOOVERLAPWITH: Checks if the interior of polygons in one region dataset not overlap with the interior of polygons in another region dataset. The overlapped region objects of the input data are incorrect.
    • REGIONCONTAINEDBYREGION: Checks if all the polygons in the first region dataset are contained within polygons in the other region dataset. The regions of the input data that are not contained by the reference data are incorrect.
    • REGIONCOVEREDBYREGION: Checks if an area in the first region dataset is covered by polygons in the other region dataset. The objects in the first dataset that are not covered by the reference data are incorrect.
    • LINENOOVERLAP: Checks if the lines are not overlapped with lines in the same dataset. The overlapped lines are incorrect.
    • LINENOOVERLAPWITH: Checks if a line in the first line dataset not overlap with any lines in the other line dataset. The overlapped line objects of the first data are incorrect.
    • POINTNOIDENTICAL: Checks if there are duplicated points in the given point dataset. Any points that overlap are errors.
  • tolerance: optional, used to set the tolerance when validating the specified topology.  The unit is the same as the unit of the source dataset. Value range is greater than or equal to 0. If the value is smaller than 0, an exception will be thrown.(Defaults to 0.000001)
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 the registered dataset name

Execute a POST request on topologyValidator resource to create a topology validation analysis job: http://supermapiserver:8090/iserver/services/distributedanalyst/rest/v1/jobs/spatialanalyst/topologyvalidator.rjson with the following request body which inputs registered dataset name:

{

    "input": {

        "datasetName": "samples_processing_newyorkZone_R"

    },

    "analyst": {

        "rule": "REGIONNOOVERLAPWITH",

        "datasetTopology": "samples_processing_singleRegion_R",

        "tolerance": ""

    }

}

then the returned resource in rjson format is as follows:

{

  "newResourceID": "6d3baaab_1486_4a6d_b90d_f0ca51132dc2",

  "newResourceLocation":"http://supermapiserver:8090/iserver/services/distributedanalyst/rest/v1/jobs/spatialanalyst/topologyvalidator/6d3baaab_1486_4a6d_b90d_f0ca51132dc2",

  "postResultType": "CreateChild",

  "succeed": true

}

 

Example 2: Input data stored in PostgreSQL

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

{

    "input": {

        "datasetInfo": {

            "type": "REGION",

            "name": "newyorkZone_R_1645948803",

            "datasourceConnectionInfo": {

                "engineType": "POSTGRESQL",

                "dataBase": "supermap",

                "password": "supermap",

                "user": "postgres",

                "server": "192.168.120.21"

            }

        }

    },

    "analyst": {

        "rule": "REGIONNOOVERLAPWITH",

        "datasetTopology": "samples_processing_singleRegion_R",

        "tolerance": "0.001"

    }

}

then the returned resource in rjson format is as follows:

{

  "newResourceID": "04483bb2_e9b1_4fe3_aa3d_39c4fdb84416",

  "newResourceLocation": "http://supermapiserver:8090/iserver/services/distributedanalyst/rest/v1/jobs/spatialanalyst/topologyvalidator/04483bb2_e9b1_4fe3_aa3d_39c4fdb84416",

  "postResultType": "CreateChild",

  "succeed": true

}

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 topologyValidator 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 topologyValidator resource supports the <format> representation.

See