edgeWeight


URI

<networkDataName_uri>/edgeweight/{edgeID}/fromnode/{fromNodeID}/tonode/{toNodeID}/weightfield/{weightField}[.<format>]

Supported methods

PUT

Parent resource

networkDataName

Introduction

The edgeWeight resource represents an edge weight. Performing a PUT request with proper parameters on the edgeWeight resource can update the weight of an edge.

Supported Methods:

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

Resource hierarchy

resources.htm

HTTP request methods

Below is an example of performing an HTTP request on a URI, with rjson as the output format. In the URI: supermapiserver is the name of the server; RoadNet@Changchun is the network data to be updated; and time is the weightField name set in the configuration file.

http://supermapiserver:8090/iserver/services/transportationanalyst-sample/rest/networkanalyst/RoadNet@Changchun/edgeweight/20/fromnode/26/tonode/109/weightfield/time.rjson

PUT request

Updates the weight of an edge.

Request parameter

Proper parameters need to be included in the URI when performing a PUT request on the edgeWeight resource. The parameters that must be passed before "?" are as follows:

Name Type Description
edgeID int The ID of the target edge.
fromNodeID int The ID of the starting node of the target edge.
toNodeID int The ID of the ending node of the target edge.
weightField String The name of the weight information (i.e., WeightFieldInfo) for the target edge.

The parameter passed in the request entity body is a double type, specifying the new weight value.

Response structure

After a PUT request is performed on the edgeWeight resource, the entity body of the response message contains a set of descriptions about whether the update is successful. The structure is as follows:

Field Type Description
succeed boolean Whether the weight of the edge was successfully updated.
errorMsg String Details about the error if failure occurs.
code int Code of the error.

Response example

Performing a PUT request on the following URI is to update the edge weights for the RoadNet@Network dataset:

http://supermapiserver:8090/iserver/services/transportationanalyst-sample/rest/networkanalyst/RoadNet@Changchun/edgeweight/20/fromnode/26/tonode/109/weightfield/time.rjson

The new weight specified in the request body is:

30.0

Given that the update is successful, the returned description of the operation result in rjson forma is as follows:

{

"succeed": true

}

See