generateSpatialData


URI

<linearReferencing_uri>/generatespatialdata[.<format>]

Supported methods

GET, POST, HEAD

Parent resouce

linearReferencing

Child resources

spatialdataResult

Introduction

Create the dynamic segmentation results resources. A spatial dataset can be generated by sending the POST request on the resource.

The dynamic segmentation relation contains three roles: route dataset, event table, and spatial data. Spatial data and event tables are in one-to-many relationship, and route dataset and spatial data are in one-to-many relationship, and an event table and spatial data are in one-to-one relationship. That is to say, a route dataset can generate multiple event tables and spatial data, but one event table can only create one spatial data.

Dynamic segmentation is based on linear reference, it uses two data structures: route dataset and event table dataset. The route object in the route dataset is the linear element with measure value in linear reference, the difference between it and the common line object is it store the third dimension information except the X, Y coordinate, that is the measure value; event table is a attribute table, it contains route field and measure field. Event table dataset can also store the concrete information of the event. Route ID is used to locate the point or line to the correct route, the measure is used to locate the corresponding point or line correctly. The route ID, measure value and other description attribute in the event table will all be right to the attribute table of the spatial data created.

The event in the event table is located after dynamic segmentation, and the corresponding point or line layer is created. The point event create point dataset, line event table create route dataset. The figure below shows the process of dynamic segmentation and create thematic map with it attribute and overlay it to the original route. The line in pastel is the original route data.

After the spatial data is created, the relations among the route dataset, event table and spatial data are inter-associative. One of the three is modified, the other two be be changed automatically.

There are 4 types supported:

1. The change of the event table description information. Inter-association between the event table and the spatial data.

The description information refers to the general field excluding route ID and measure field. If you change the description of the event table, the description of spatial will be changed automatically, and vise versa.

2. The route position change of events. Inter-association between the event table and the spatial data.

Changing the route position of events means changing the measure value of event table or spatial data. When changing a m-value in the event table, the geometric and attribute information of the corresponding line/point object will be changed at the same time; when changing the m-value of the spatial data, the corresponding geometry will be changed at the same time, so was the m-value of the corresponding event in the event table. If it is line event, the length and location can be changed by modifying the FromM and ToM.

As shown below, after the spatial data is changed, the measure value of the first event is changed into (150.00,180.00) from (20.78, 79.37). If there is no intersection between the m-value changed and the corresponding route m-value, the geometry of the spatial data will not change, for example, the from-measure and to-measure changed is (26,60), and the measure of the corresponding route is (3,20); if part of the line event changed is on the route, the geometry on the spatial data will be changed to the intersection part.

3. The route change of events. In this case, the spatial data and the event table will change as the route changed. But when changing the spatial data, the corresponding route data will not be changed, only the event table will be changed. This case is suit for the data error or data change. There are the following situations:

 

4. When changing the event table structure, the attribute table of spatial data will be changed automatically.

The change of the structure of the event table refers to adding or deleting fields. In this case, the structure of the attribute table of spatial data will be changed, too.

Note:

1. The event table used to create spatial data must contain route ID field and measure field (point event contains M field, line event contains FromM and ToM fields). Route ID is used to locate line or point to the corresponding route, the measure field value locates the point or line event correctly. The route ID filed, measure field and the property that describe the event will all be written to the attribute table of the spatial data.

2. In spatial data, there is a field Event_SMID built automatically to record SMID of the event table. Note that this field cannot be changed.

3. If an event table already has a dynamic segmentation relation, the spatial data cannot be generated again. So, before generating spatial data by calling GenerateSpatialData, you need use the getDynSegInfos method of the {@link DynamicSegmentManager DynamicSegmentManager} class to check whether it has a dynamic segmentation relation. If yes, delete this relation using removeDynSegInfos.

4. When calibrating, dissolving event table, creating route with line reference points, if the dataset used contains dynamic segmentation relationship, unwanted linked change may be caused, and may result in errors in the analysis that follows. So it is not recommended to use the dataset that contains dynamic segmentation relationship directly, you can copy it, or delete the dynamic segmentation relationship (you must be cautious about this process, once you deleted the dynamic segmentation relationship, the three roles may not be inter-associative and can't be changed connected).

5. After building the dynamic segmentation relationship, there may be exceptions when deleting a dataset that has dynamic segmentation relationship, you need to delete the dynamic segmentation relationship first. It is recommended to check and delete the dynamic segmentation relationship or delete the dynamic segmentation relationship directly before deleting the dataset.

 

Supported Methods:

Supported output formats: rjson, json, html, xml.

Resource hierarchy

HTTP request methods

Implement the HTTP request on the following URI, where supermapiserver is the server name, with rjson being the output format.

http://supermapiserver:8090/iserver/services/spatialanalyst-changchun/restjsr/spatialanalyst/datasets/RouteDT_road@Changchun/linearreferencing/generatespatialdata.rjson

GET request

Gets a form for the POST request.

POST request

Perform linear reference analysis once, that is create spatial data resource with route dataset and event table.

Note: For the event table that has created spatial data, it is not supported to create other spatial data again.

Request parameter

The request body should contain the following parameters:

Name Type Description
routeIDField String The route ID field in the route dataset used to create spatial data. The Route Identifier Field supports the folliwng types as shown in the table below.
routeDataset String The route dataset name for spatial data.
eventTable String The event table name used to create spatial data.
eventRouteIDField String The route ID field in the event table used to create spatial data.
measureField String The measure field of the event table used to create spatial data, this attribute is available only when the event is point event.
The field type supported currently is double.
measureStartField String The start measure field of the event table used to create spatial data, this attribute is available only when the event is line event.
The field type supported currently is double.
measureEndField String The end measure field of the event table used to create spatial data, this attribute is available only when the event is line event.
The field type supported currently is double.
measureOffsetField String [Optional parameter]
measure value offset field.
errorInfoField String [Optional parameter]
Error information field, write to the original event table directly after setting, used to describe the error information.
dataReturnOption DataReturnOption The setting for result return.
retainedFields String[] Gets or sets the fields collection (except system fields) in the event table which will be reserved into the results spatial data.
When generating spatial data, regardless of specifying the reserved field, the routing ID field, the offset field and the scale value field (point event is the scale field, line events are the starting and ending scale fields) will be reserved into the result spatial data; if you don't specify the retainedFields parameter or the length of the retainedFields parameter array is 0, then return all user fields.

In which, the character, wide character and text field contains figures only.

Response structure

The parameters contained in the response result are as the following:

Field Type Description
succeed boolean Whether the analysis is successful.
newResourceID String The ID for the analysis result resource.
postResultType PostResultType

The result type fo the POST request.

newResourceLocation String The URI of the newly created resource.

Respose example

Perform POST request on http://localhost:8090/iserver/services/spatialanalyst-changchun/restjsr/spatialanalyst/datasets/RouteDT_road@Changchun/linearreferencing/generatespatialdata.rjson the request body is as the following:

{

    "routeIDField": "RouteID",

    "eventTable": "LinearEventTabDT@Changchun",

    "eventRouteIDField": "RouteID",

    "measureField": "",

    "measureStartField": "LineMeasureFrom",

    "measureEndField": "LineMeasureTo",

    "measureOffsetField": "",

    "errorInfoField": "",

    "dataReturnOption": {

        "dataset": "test",

        "dataReturnMode": "DATASET_AND_RECORDSET",

        "expectCount": 1000,

        "deleteExistResultDataset": false

    }

}

The response result in rjson format returned is as follows:

{

    "succeed": true,

    "newResourceID": "m2qzopes_2ee053dc196b4b469576186239e8ddd5",

    "postResultType": "CreateChild",

    "newResourceLocation": "http://localhost:8090/iserver/services/spatialanalyst-changchun/restjsr/spatialanalyst/datasets/RouteDT_road@Changchun/linearreferencing/generatespatialdata/m2qzopes_2ee053dc196b4b469576186239e8ddd5"

}

Performing a GET request on http://localhost:8090/iserver/services/spatialanalyst-changchun/restjsr/spatialanalyst/datasets/RouteDT_road@Changchun/linearreferencing/generatespatialdata/m2qzopes_2ee053dc196b4b469576186239e8ddd5.rjson can retrieve detailed information about the analysis result. Please see datasetIsolineResult.

HEAD request

Asks for the response identical to the one that would correspond to a GET request, but without the response body. This is useful for retrieving meta-information written in response headers, without having to transport the entire content. The meta-information includes the media-type, content-encoding, transfer-encoding, content-length, etc.

HEAD request can be used to check if the generateSpatialData resource exists, or if the resource can be accessed by clients. It can also determine if the generateSpatialData resource supports an output format <format> if performed on a URI with .<format> included.

See