URI
<geometry_uri>/routelocator[.<format>]
Supported methods
Parent resource
Child resources
Introduction
The routeLocatorResults resource. You can create a routeLocatorResult resource through implementing the POST request on this resource.
Supported Methods:
- GET: Returns a form for the POST request.
- POST: Returns the created routeLocatorResults resource, including locater point and locater line.
- HEAD: Checks whether routeLocatorResults resource exists, or whether it can be accessed.
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-sample/restjsr/spatialanalyst/geometry/routelocator.rjson
GET request
Gets a form for the POST request.
POST request
Returns the created route locater point (line) analysis result.
Request parameter
Name | Type | Description |
sourceRoute | Route | [Required] The route object. |
type | LocateType | [Required] Type: Point or Line. |
measure | double | The M value of the locater point. Meaningful only when the route object is locater point. |
offset | double | The offset of the locater point. Meaningful only when the route object is locater line. The default value is 0. |
isIgnoreGap | boolean | Wether to ignore the distance among child objects. The default is false, indicating not to ignore the distance among child objects. |
startMeasure | double | The start M value of the locater line. Meaningful only when the route object is locater line. |
endMeasure | double | The end M value of the locater line. Meaningful only when the route object is locater line. |
Response structure
The resonse parameters are as follows:
Field | Type | Description |
succeed |
boolean | Whether the analysis result have been created successfully. |
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. |
Response example
Suppose we implement the POST request on the routeLocatorResults resource http://localhost:8090/iserver/services/spatialanalyst-sample/restjsr/spatialanalyst/geometry/routelocator.rjson to perform a route locater point operation. The rjson format request body sent is as follows:
{
"sourceRoute": {
"type": "LINEM",
"parts": [4],
"points": [{
"measure": 0,
"y": -6674.466867067760,
"x": 3817.3527876130100
},
{
"measure": 199.57954019411700,
"y": -6670.830929417590,
"x": 3617.806369901500
},
{
"measure": 609.3656478634480,
"y": -6877.837541432360,
"x": 3264.1498746678400
},
{
"measure": 936.0174126282960,
"y": -7038.687780615180,
"x": 2979.846206068900
}]
},
"type": "POINT",
"measure": 10,
"offset": 0,
"isIgnoreGap": false
}
The result in rjson format returned is as follows:
{
"succeed": true,
"newResourceID": "ryw0x19a_478fb6d0164248c79e05fcb955a19dfe",
"postResultType": "CreateChild",
"newResourceLocation": "http://localhost:8090/iserver/services/spatialanalyst-sample/restjsr/spatialanalyst/geometry/routelocator/ryw0x19a_478fb6d0164248c79e05fcb955a19dfe"
}
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 routeLocatorResults resource exists, or if the routeLocatorResults resource can be accessed by clients. It can also determine if the routeLocatorResults resource supports an output format <format> if performed on a URI with .<format> included.