URI
<networkDataName_uri>/weightmatrix[.<format>]
Supported methods
Parent resource
Introduction
The weightMatrix resource is used to retrieve the result of weight matrix calculation, through performing a GET request on this resource.
Supported methods
- GET: Gets the result of weight matrix calculation.
- HEAD: Checks if the weightMatrix resource exists, or if there is permission to access the weightMatrix resource.
Supported output formats:rjson, json, html, xml, jsonp.
GIS Services Resource Hierarchy
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 name of the network dataset to be analyzed; [2,6,9] is an array of IDs of the network nodes that participate in weight matrix calculation.
http://supermapiserver:8090/iserver/services/transportationanalyst-sample/rest/networkanalyst/RoadNet@Changchun/weightmatrix.rjson?nodes=[2,6,9]
GET Request
Gets the result of weight matrix calculation.
Request parameters
Proper parameters need to be included in the URI when performing a GET request on the weightMatrix resource.
Field | Type | Definition |
nodes | int[]/Point2D[] | Required A set of nodes participating in weight matrix calculation. |
parameter | TransportationAnalystParameter | General parameters for transportation network analyst. |
Response structure
After a GET request is performed on the weightMatrix resource to get the weight matrix, a two-dimensional array with numbers as elements is returned in JSON format.
Example of response
Performing a GET request on the following URI is to perform weight matrix analysis on the RoadNet@Changchun dataset:
http://supermapiserver:8090/iserver/services/transportationanalyst-sample/rest/networkanalyst/RoadNet@Changchun/weightmatrix.rjson?nodes=[2,6,9]
The returned response content is as follows:
[
[
0,
454,
434
],
[
454,
0,
62
],
[
434,
62,
0
]
]
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 weightMatrix resource exists, or if the resource can be accessed by clients. It can also determine if the weightMatrix resource supports an output format <format> if performed on a URI with .<format> included.