public class FindPathService
extends java.lang.Object
最佳路径分析服务类。
最佳路径是在网络数据集中指定一些结点,按照顺序访问结点从而求解起止点之间阻抗最小的路径。例如如果要顺序访问1、2、3、4四个结点,则需要分别找到1、2结点间的最佳路径 R1—2,2、3 间的最佳路径 R2—3 和 3、4结点间的最佳路径 R3—4,顺序访问1、2、3、4四个结点的最佳路径就是 R= R1—2 + R2—3 + R3—4。 阻抗就是指从一点到另一点的耗费,在实际应用中我们可以将距离、时间、花费等作为阻抗条件。阻抗最小也就可以理解为从一点到另一点距离最短、时间最少、花费最低等。当两点间距离最短时为最短路径,它是最佳路径问题的一个特例。阻抗值通过 TransportationAnalystParameter.weightFieldName 设置。 计算最佳路径除了受阻抗影响外,还受转向字段的影响。转向值通过 TransportationAnalystParameter.turnWeightField 设置。
最佳路径属于网络分析的一种。网络分析是针对网络数据集的应用。网络数据集为具有拓扑关系的包含了一个网络结点子数据集的线图层,因此网络数据集拥有两个属性表,一个是记录弧段信息的属性表,一个是记录结点信息的属性表。 最佳路径分析和最佳路径分析都是在网络中寻找遍历所有指定结点的最经济的路径,区别在于遍历所有结点的过程中对结点访问顺序不同。最佳路径分析必须按照指定顺序对站点进行访问,而最佳路径分析是无序的路径分析。
该类负责将客户端指定的最佳路径分析参数传递给服务端,并接收服务端返回的结果数据,将最终结果存储于 FindPathResult 中。
限定符和类型 | 类和说明 |
---|---|
static class |
FindPathService.FindPathEventListener
处理最佳路径分析结果的监听器抽象类。
|
构造器和说明 |
---|
FindPathService(java.lang.String url)
构造函数。
|
限定符和类型 | 方法和说明 |
---|---|
FindPathResult |
getLastResult()
返回最佳路径分析结果。
|
<T> void |
process(FindPathParameters<T> params, FindPathService.FindPathEventListener listener)
根据最佳路径分析与服务端完成异步通讯,即发送分析参数,并通过实现FindPathEventListener监听器处理分析结果。
|
public <T> void process(FindPathParameters<T> params, FindPathService.FindPathEventListener listener)
根据最佳路径分析与服务端完成异步通讯,即发送分析参数,并通过实现FindPathEventListener监听器处理分析结果。
params
- 最佳路径分析参数信息。listener
- 处理分析结果的FindPathEventListener监听器。public FindPathResult getLastResult()
返回最佳路径分析结果。