location


URI

<networkDataName_uri>/location[.<format>]

Supported methods

GET

HEAD

Parent resource

networkDataName

Introduction

The location resource represents the location-allocation analysis function. With parameters properly set, a GET request can be performed on the location resource to retrieve a location-allocation analysis result. For detailed description of location-allocation analysis, please refer to Location-allocation analysis.

Supported methods:

Supported output formats: rjson, json, jsonp, html, xml.

GIS Services Resource Hierarchy

resources.htm

HTTP request methods

Below is an example of performing an HTTP request on a URI, with rjson as the output format. supermapiserver in the URI is the name of the server, and RoadNet@Changchun is the name of the network data to be analyzed.

http://supermapiserver:8090/iserver/services/transportationanalyst-sample/rest/networkanalyst/RoadNet@Changchun/location.rjson?supplyCenters=[{"nodeID":7,"maxWeight":3,"resourceValue":100,"type":"OPTIONALCENTER"},{"nodeID":8,"maxWeight":3,"resourceValue":100,"type":"OPTIONALCENTER"}]&expectedSupplyCenterCount=1

GET request

Gets a location-allocation analysis result.

Request parameters

Proper parameters need to be included in the URI when performing a GET request on the location resource:

Name Type Description
supplyCenters SupplyCenter[] Required
A set of resource supply centers.
isFromCenter boolean Whether to allocate resource from the resource supply center.
expectedSupplyCenterCount int The expected number of resource supply centers used for finally locating the facilities.
nodeDemandField String The name of the field representing the amounts of resource demand at the nodes.
weightName String The name of the field representing the weight information.
turnWeightField String The name of the field representing the turn weights.
returnEdgeFeatures boolean Whether to return the edge features.
returnEdgeGeometry boolean Whether to return the edge geometry.
returnNodeFeatures boolean Whether to return the node features.

Response structure

Performing a location-allocation analysis would return a response with the structure as the representation of the LocationAnalystResult class. Please see the online JavaDoc for information about the specific fields.

Example usage

Performing a GET request on the following URI is to perform location-allocation analysis on the RoadNet@Changchun dataset:

 

http://localhost:8090/iserver/services/transportationanalyst-sample/rest/networkanalyst/RoadNet@Changchun/location.rjson?supplyCenters=[{"nodeID":7,"maxWeight":3,"resourceValue":100,"type":"OPTIONALCENTER"},{"nodeID":8,"maxWeight":3,"resourceValue":100,"type":"OPTIONALCENTER"}]&expectedSupplyCenterCount=1

The returned response content is as follows:

HEAD request

Returns the same HTTP response header as GET does, but no response entity is included. HEAD request can be used to get metadata from the response message header without transporting the entire response content. Metadata includes information about the media type, character encoding, compression encoding, the length of the entity content, etc.

HEAD request can be used to check if the location resource exists, or if the resource can be accessed by clients. It can also determine if the location resource supports an output format <format> if performed on a URI with .<format> included.

See