URI
<networkDataName_uri>/closestfacility[.<format>]
Supported methods
Parent resource
Introduction
The closestfacilities resource represents the closest facility analysis function. Performing a GET request on the closestfacilities resource with proper parameters can retrieve a closest facility analysis result. For detailed description of the closest facility analysis, please refer to Closest facility analysis.
Supported methods
- GET: Gets the closest facility analysis result.
- HEAD: Checks whether the closestFacility resource exists or whether the client has the permission to access the closestFacility resource.
Supported output formats: rjson, json, html, xml.
GIS Services Resource Hierarchy
HTTP request methods
Below is an example of performing a 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 for closest facility analysis; 3 is ID of the node where the event is, i.e., the location of the event is identical with the location of node 3; [1, 6, 21] is an array of node IDs, indicating the locations of the facilities, i.e., the facilities are exactly located at nodes 1, 6, and 21.
http://supermapiserver:8090/iserver/services/transportationanalyst-sample/rest/networkanalyst/RoadNet@Changchun/closestfacility.rjson?event=3&facilities=[1,6,21]
GET Request
Gets the closest facility analysis result.
Request parameters
Proper parameters need to be included in the URI when performing a GET request on the closestfacilities resource.
| Field | Type | Definition |
| event | int/Point2D | Required Events can be denoted by the ID or coordinates of the event, but which must be consistent with the facility, i.e., both the facility and the event can be denoted by ID or coordinates. |
| facilities | int[]/Point2D[] | Required Facilities set can be denoted by the ID or coordinates of the facility, but which must be consistent with the event, i.e., both the facility and the event can be denoted by ID or coordinates. Facilities set. |
| expectFacilityCount | int | The count of facilities needed to be found. |
| fromEvent | boolean | Whether to start from the event location when searching for facilities. |
| maxWeight | double | Search radius. The unit is the same as that of the "weight" field in parameter (the general parameters of transportation analysis). |
| parameter | TransportationAnalystParameter | General parameters for transportation network analyst. |
Response structure
After the closest facility 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 |
| facilityPathList | List<ClosestFacilityPath> | A list of path(s) between the event and the facility location. |
Example of response
Performing a GET request on the following URI is to perform closest facility analysis on the RoadNet@Network dataset:
http://supermapiserver:8090/iserver/services/transportationanalyst-sample/rest/networkanalyst/RoadNet@Changchun/closestfacility.rjson?event=3&facilities=[1,6,21]
The returned representation of the analysis result is as follows:
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 closestFacility resource exists, or if the resource can be accessed by clients. It can also determine if the closestFacility resource supports an output format <format> if performed on a URI with .<format> included.