URI

<networkService_uri>/{closestFacilityLayerName}/solveClosestFacility[.<format>]

支持的方法

GETPOSTHEAD

父资源

networkService

介绍

最近设施分析 。

支持的方法:

  • GET:获取最近设施分析结果。
  • POST:根据给定条件,创建最近设施分析结果。
  • HEAD:检查 solveClosestFacility  资源是否存在,或权限是否可以访问 solveClosestFacility  资源。

资源层次

HTTP 请求方法

对如下 URI 执行 HTTP 请求,以 json 输出格式为例加以说明,其中,supermapiserver 是服务器名,{component}是服务组件名,{networkdataName}是网络数据名,{closestFacilityLayerName}是最近设施图层名。

http://supermapiserver:8090/iserver/services/{component}/arcgisrest/{networkdataName}/NAServer/{closestFacilityLayerName}/solveClosestFacility.json

GET 请求

请求参数

名称 类型 含义
incidents Point2D[] 【必需】 要搜索附近位置的一个或多个点,称为事件点
facilities Point2D[] 【必需】 在查找最近位置时要搜索的一个或多个点,称为设施点
defaultTargetFacilityCount int 【必需】 要查找的设施点数量,必须大于零
travelDirection String 分析方向
defaultCutOff double 结束查找的半径或时间
barriers Point2D[] 障碍点集合
impedanceAttributeName

String

权值字段
returnDirections boolean 是否返回方向

returnCFRoutes

boolean 是否返回路由
returnFacilities boolean 是否返回设施点
returnIncidents boolean 是否返回事件点
returnBarriers boolean 是否返回障碍点
outSR String 输出坐标系

响应结构

对 solveClosestFacility 资源执行 GET 请求,返回的资源表述的结构如下:

字段 类型 说明
facilities PointSet 设施点
incidents PointSet 事件点
barriers PointSet 障碍点
routes Routes 路线
messages String[] 信息
directions Direction[] 方向

响应示例

对 olveClosestFacility 资源:http://localhost:8091/iserver/services/transportationAnalyst-Changchun/arcgisrest/RoadNet@Changchun/NAServer/closestFacilityLayer/solveClosestFacility?f=pjson&barriers=null&incidents=119.6100397551,-122.6278394459&facilities=70.1515638201,-54.7406354454;550.6770595320,-56.1050211383;445.6471889264,-229.2074549041&impedanceAttributeName=null&returnDirections=true&returnCFRoutes=true&defaultTargetFacilityCount=1&travelDirection=esriNATravelDirectionFromFacility&defaultCutOff=null 执行 GET 请求,返回的 pjson 格式的表述如下:

{

    "routes": {

        "features": [{

            "attributes": null,

            "geometry": {

                "paths": [[

                    [

                        70.1515638200593,

                        -54.7406354454158

                    ],

                    [

                        76.18348947781757,

                        -134.92485855116797

                    ],

                    [

                        111.01197574440013,

                        -124.66628623264731

                    ],

                    [

                        119.61003975513272,

                        -122.62783944590828

                    ]

                ]],

                "spatialReference": {}

            }

        }],

        "spatialReference": {},

        "geometryType": "esriGeometryPolyline"

    },

    "barriers": null,

    "directions": [{

        "summary": {

            "envelope": {

                "ymin": -134.92485855116797,

                "xmin": 70.1515638200593,

                "ymax": -54.7406354454,

                "xmax": 119.61003975513272,

                "spatialReference": null

            },

            "totalTime": 125.55505631810306,

            "totalLength": 125.55505631810306

        },

        "features": [

            {

                "compressedGeometry": "+9h5k0+kt0hrm-ga1ggi",

                "attributes": {

                    "length": 0,

                    "maneuverType": "esriDMTStop",

                    "time": 0,

                    "text": "从此处出发"

                }

            },

            {

                "compressedGeometry": "+9h5k0+kt0hrm-ga1ggi+1pgpgo-nsm91n",

                "attributes": {

                    "length": 80.41078138044527,

                    "maneuverType": "esriDMTUnknown",

                    "time": 80.41078138044527,

                    "text": "向南80.41078138044527米"

                }

            },

            {

                "compressedGeometry": "+9h5k0+mmhbce-186npi9",

                "attributes": {

                    "length": 0,

                    "maneuverType": "esriDMTTurnLeft",

                    "time": 0,

                    "text": "左转"

                }

            },

            {

                "compressedGeometry": "+9h5k0+mmhbce-186npi9+ac4ptv+31qlbq+2hvtf0+je2mk",

                "attributes": {

                    "length": 45.14427493765779,

                    "maneuverType": "esriDMTUnknown",

                    "time": 45.14427493765779,

                    "text": "向东45.14427493765779米"

                }

            },

            {

                "compressedGeometry": "+9h5k0+13km2pd-14hf1fq",

                "attributes": {

                    "length": 0,

                    "maneuverType": "esriDMTStop",

                    "time": 0,

                    "text": "到达路由点2"

                }

            }

        ]

    }],

    "incidents": null,

    "messages": [],

    "facilities": null

}

POST 请求

跟 GET 请求结构类似。

HEAD 请求

返回跟 GET 请求一样的 HTTP 响应头,但是没有响应实体。可以在不必传输整个响应内容的情况下,获取包含在响应消息头中的元数据信息。元数据信息包括媒体类型,字符编码,压缩编码,实体内容长度等。

HEAD 请求可以用来判断 solveClosestFacility 资源是否存在,或者客户端是否有权限访问 solveClosestFacility 资源。通过对加.<format>的 URI 执行 HEAD 请求,还可以快速判断 solveClosestFacility 资源是否支持<format>格式的表述。

请参见