<networkDataName_uri>/tsppath[.<format>]
The TSPPath resource represents the traveling salesmen analysis function. With parameters properly set, a GET request can be performed on the TSPPath resource to retrieve a traveling salesmen analysis result.
A traveling salesmen analysis is to find a path that passes a specified sequence of points. The order in which the points are visited are not specified. The salesman can decide the visiting order himself. The goal is to find the traveling route with the (almost) least total cost. If the ending point is specified in a traveling salesmen analysis, that point must be visited last by the salesman. The order in which the other points are visited can be decided by the salesman himself.
Note that the turning weight of the target point will not be take into consideration when performing travelling salesmen analysis.
For more details about travelling salesmen analysis, see:Travelling salesmen analysis
Supported methods
Supported output formats:rjson, json, html, xml, jsonp.
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 data to be analyzed; and [2,6,9,18,25] is an array of nodes representing the locations of the stops during traveling salesman analysis.
http://supermapiserver:8090/iserver/services/transportationanalyst-sample/rest/networkanalyst/RoadNet@Changchun/tsppath.rjson?nodes=[2,6,9,18,25]
Gets the results of travelling salesmen analysis.
Proper parameters need to be included in the URI when performing a GET request on the tspPath resource.
Field | Type | Definition |
nodes | int[]/Point2D[] | Required The nodes to visit in the travelling salesmen analysis, i.e. the target point. |
endNodeAssigned | boolean | Whether to assign an ending node. A "true" value indicates that an ending point is assigned as the traveling salesman抯 last stop to visit, i.e., the last point on a specific path. |
parameter | TransportationAnalystParameter | General parameters for transportation network analyst. |
After the traveling salesman analysis function is performed, the returned representation of the operation result has the following structure (the representation is included in the entity body of the response message):
Name | Type | Description |
tspPathList | List<TSPPath> | A list of paths resulted from traveling salesman analysis. |
Performing a GET request on the following URI is to perform a traveling salesmen analysis on the RoadNet@Changchun dataset:
http://supermapiserver:8090/iserver/services/transportationanalyst-sample/rest/networkanalyst/RoadNet@Changchun/tsppath.rjson?nodes=[2,6,9,18,25]
The returned response content is as follows:
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 tspPath resource exists, or if the resource can be accessed by clients. It can also determine if the tspPath resource supports an output format <format> if performed on a URI with .<format> included.