在网络上使用方位角以更加精确地定位点
当您执行网络分析时,Network Analyst 必须确定每个分析输入所在的网络数据集上的位置。 将根据多个因素来计算网络位置,其中包括输入的地理位置、将使用其输入的网络分析的设置,以及用于定位输入的工具或功能中的用户指定位置设置。
车辆行驶方向是一个附加因素,可以帮助精度确定其在网络上的位置。 下图说明了这一原理。
<img alt="无方位角的 GPS 位置表示为圆圈" data-caption="Without bearing information, it is hard to tell which street the vehicle is on. It could be on either the north–south or east–west street." src="images/ADot-AE9CA.png" />
<img alt="有方位角的 GPS 位置表示为三角形" data-caption="It becomes clear that the vehicle is heading north on the north–south street when the bearing information is included." src="images/ATriangle-09084.png" />
ArcGIS Network Analyst 扩展模块允许您使用此原则在网络数据集上精确定位点。
除了当前地理位置之外,GPS 设备通常还会计算方位角。 在网络分析期间,您可以在定位网络上的点时使用此信息。 这样做可以更准确地放置网络分析对象。 另外,这还有助于防止驾驶员混淆,因为通过这些移动点生成的路径和方向更有可能从正确的位置开始。
常见的做法是,例如,使用配备 GPS 接收器的移动电话将货车当前位置和方位角发送给 ArcGIS Server,此信息将在其中加载为路径分析中的第一个停靠点。 货车尚未到达的其它停靠点也同样被加载,对路径进行求解并将结果和方向发送回驾驶员的手机上。 在此过程中使用方位角信息有助于防止货车在碰巧靠近十字路口或立交桥时在错误的街道上开始其路径。 此信息还有助于 ArcGIS Network Analyst 扩展模块验证车辆行驶的方向,以使生成路径的起点和车辆当前行驶的方向匹配。
方位角和 BearingTol 字段
ArcGIS Network Analyst 扩展模块可以使用网络分析输入中 Bearing 和 BearingTol 字段的方位角信息。 这些字段如下所述。
Bearing- 车辆或行人的移动方向。 必须以度为单位指定方位角,并从正北开始顺时针进行测量。 通常,值介于 0 和 360 之间;然而,Network Analyst 也可以解释负值,方法是从 360 度中减掉这些值。BearingTol- 方位角容差 (bearing tolerance) 的简称,此字段用于指定车辆行驶路线和从 Network Analyst 尝试定位车辆所在街道上一点引出的切线之间的最大可接受差异。 换言之,方位角容差用来确定车辆移动的方向是否大体上与基础道路一致。 如果它们在给定容差范围内,车辆将定位在这条边上;如果没在给定范围内,将计算出下一个最近的合适边。BearingTol单位为度,默认值为 30。 可以选择任何大于 0 且小于 180 的容差。
Network Analyst 及 Bearing 和 BearingTol 字段
以下步骤概述了 Network Analyst 评估方位角字段的方式:
Network Analyst 可将点捕捉到最近的边。
将根据最近的边上的点来计算方位角容差,以设置最小和最大方位角值。 将针对两个行驶方向执行此操作。
执行操作时,应分别比较用户所添加的点的方位角与两个行使方向上的最小和最大允许方位角值的差值。
如果所添加点的方位角在容差范围之内,则点将作为网络位置添加到该处。 还会确定道路上的行驶方向 - 该方向与方位角容差(方位角在其范围内)的方向匹配。
如果方位角在容差范围外,则不定位此点,并将计算下一个最近的合适边的方位角容差。 (有些边由于其他原因无法计算;例如,如果您已选择不在受限元素上定位或排除所有的高速公路。 在这种情况下,被禁止的所有边或公路都将跳过。)此过程会重复执行,直到将点定位到合适的边上,或者在超出指定的捕捉容差之后,此点保持未定位状态为止。
在分析中使用 Bearing 和 BearingTol 字段
使用网络分析图层执行分析并加载输入类(例如停靠点、设施点或起始点)的点时,添加位置工具将自动使用输入表中的 Bearing 和 BearingTol 字段。 无需使用字段映射或进行任何特殊配置。 如果字段存在于输入数据中,则将使用这些字段。
使用 Network Analyst 模块 arcpy.nax 在 Python 中执行分析时,Bearing 和 BearingTol 字段将显式包含在每个分析输入类的受支持字段列表中。 要使用这些字段,可以使用 load 方法的 field_mappings 参数将输入中的字段映射到输入类中的字段中,操作方法与您要映射的任何其他输入字段一样。
了解有关 Network Analyst 模块中字段映射的详细信息
注:
在预先计算网络位置时,计算位置工具不会使用 Bearing 和 BearingTol 字段。
注意:
方位角可能会影响分析输入所在的街道(定位计算的一部分),但不会影响车辆到达和离开某个位置的方向(求解计算的一部分)。 例如,如果车辆的方位角指向北,则 Bearing 和 BearingTol 字段将帮助其定位在南北方向的道路上。 然而,在求解时,生成的路径可能从该位置向南行驶,以实现到下一停靠点的最短路径。 可以使用CurbApproach字段来控制到达和离开某个位置的行驶方向。
在使用 Bearing 和 BearingTol 字段时,请记住以下几点:
输入数据中的
Bearing和BearingTol字段必须为短整型、长整型或双精度型数据。如果某点的映射输入字段值为空,则将以标准方式定位此点,即不考虑方位角和方位角容差。
示例
下方的系列图形和附带的标题说明了 Network Analyst 处理 Bearing 和 BearingTol 字段的方式。
<img alt="向北行驶的车辆" data-caption="1. A vehicle with a GPS receiver on a mobile phone travels north through a four-way intersection and sends its current location and bearing to ArcGIS Server running the Network Analyst extension." src="images/BearingBearingTol_01-E1456.png" />
<img alt="GPS 坐标和方位角" data-caption="2. The black lines represent network edges. The triangle and the dashed line represent the location and bearing of the vehicle as recorded by the GPS receiver. Note that the captured location is rather inaccurate, possibly due to inaccuracies of the GPS receiver, inaccuracies of the digitized streets, or both. The GPS receiver also indicates the bearing is about 345 degrees, which is slightly incorrect too; it should be 0 degrees since the vehicle is traveling north." src="images/BearingBearingTol_02-4D695.png" />
<img alt="方位角在方位角容差范围之外" data-caption="3. The point is snapped to the nearest edge, and compared with the bearing tolerance, which is represented by the blue gradients in this example. The BearingTol value is 30, so the tolerance spans 15 degrees to either side of the edge in both the east and west directions. The red arrows are added to emphasize that the bearing is more than 15 degrees from the edge in both directions. Since the bearing falls outside the tolerance, the point isn't located on this edge." src="images/BearingBearingTol_03-257E5.png" />
<img alt="方位角在方位角容差范围之内" data-caption="4. The point is snapped to the next-nearest edge and loaded as a network location there since the bearing falls inside the bearing tolerance. Also, the Network Analyst extension knows the object is going north since the bearing falls within the north-facing bearing tolerance." src="images/BearingBearingTol_04-A4892.png" />