routeCalculateMeasureResults


URI

<geometry_uri>/calculatemeasure[.<format>]

Supported methods

GET, POST, HEAD

Parent resource

geometry

Child resources

routeCalculateMeasureResult

Introduction

Calculates the M value for specified points based on route object. A result resource for M value calculation will be returned through implementing the POST request on this resource.

Supported Methods:

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/calculatemeasure.rjson

GET request

Gets a form for the POST request.

POST request

Returns the result resource for M value calculation.

Request parameter

Name Type Description
sourceRoute Route [Required]
The route object.
point Point2D [Required]
The point object.
tolerance double [Optional]
The tolerance value.
isIgnoreGap boolean [Optional]
Wether to ignore the distance among child objects. The default is false, indicating not to ignore the distance among child objects.

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 routeCalculateMeasureResults resource http://localhost:8090/iserver/services/spatialanalyst-sample/restjsr/spatialanalyst/geometry/calculatemeasure.rjson to calculate the M value of a specified point, the rjson format rqeust body would be 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

        }]

    },

    "tolerance": 1,

    "point": {

        "x": 3330.7754269417,

        "y": -6838.8394457216

    },

    "isIgnoreGap": false

}

The result in rjson format returned is as follows:

{

    "succeed": true,

    "newResourceID": "ejqx9g7j_a3cf1644f4fe47669272e1c3b104fd5d",

    "postResultType": "CreateChild",

    "newResourceLocation": "http://localhost:8090/iserver/services/spatialanalyst-sample/restjsr/spatialanalyst/geometry/calculatemeasure/ejqx9g7j_a3cf1644f4fe47669272e1c3b104fd5d"

}

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 routeCalculateMeasureResults resource exists, or if the routeCalculateMeasureResults resource can be accessed by clients. It can also determine if the routeCalculateMeasureResults resource supports an output format <format> if performed on a URI with .<format> included.

See