Net
Net类初始化
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
link_gdf
|
GeoDataFrame
|
线层数据, 必需参数 |
None
|
node_gdf
|
GeoDataFrame
|
点层数据, 必需参数 |
None
|
link_path
|
str
|
link层的路网文件路径, 若指定了该参数, 则直接从磁盘读取线层, 可选参数 |
None
|
node_path
|
str
|
node层的路网文件路径, 若指定了该参数, 则直接从磁盘读取点层, 可选参数 |
None
|
cut_off
|
float
|
路径搜索截断长度, 米 |
1200.0
|
not_conn_cost
|
float
|
不连通路径的阻抗(m) |
1000.0
|
fmm_cache
|
bool
|
路径预计算参数1:是否启用路径预计算 |
False
|
fmm_cache_fldr
|
str
|
路径预计算参数2:存储路径预计算结果的文件目录 |
'./'
|
recalc_cache
|
bool
|
路径预计算参数3:是否重新进行路径预计算, 取值False时, 程序会去fmm_cache_fldr下读取缓存, 若读取失败则会重新进行路径预计算 |
True
|
cache_cn
|
int
|
路径预计算参数4:使用几个核进行路径预计算 |
1
|
cache_slice
|
int
|
路径预计算参数5:大于0的整数, 表示将路径预计算结果切分为cache_slice份(大规模路网启用预计算时, 增大该值可以防止内存溢出) |
None
|
prj_cache
|
bool
|
是否启用投影缓存 |
False
|
is_hierarchical
|
bool
|
是否启用空间分层 |
False
|
cache_path
|
bool
|
是否缓存最短路径, 该参数只在use_sub_net=False且fmm_cache=False时生效, 即:匹配过程中计算好的单源最短路信息会被缓存用于减少后续的最短路计算量, 该选项启用后有可能会造成内存溢出问题 |
True
|
grid_len
|
float
|
启用空间分层时, 该参数起效, 意为将路网区域划分为grid_len(m)的栅格 |
2000.0
|
cache_name
|
str
|
路径预存储的标志名称, 默认cache |
'cache'
|
plane_crs
|
str
|
要使用的平面投影坐标系, 用户若不指定, 程序会依据路网的经纬度范围自动进行6度投影带的选择, 推荐使用程序自动 |
None
|
weight_field
|
str
|
搜路权重字段, 目前只能为length |
'length'
|
create_single
|
bool
|
是否在初始化的时候创建单向路网(若该Net传入地图匹配模块中, 无需指定使用默认值即可) |
True
|
search_method
|
str
|
路径搜索方法, 目前只能为dijkstra |
'dijkstra'
|
is_sub_net
|
bool
|
用户不可指定 |
False
|
init_from_existing
|
bool
|
用户不可指定 |
False
|
double_single_mapping
|
dict
|
用户不可指定 |
None
|
link_ft_mapping
|
dict
|
用户不可指定 |
None
|
link_f_mapping
|
dict
|
用户不可指定 |
None
|
link_t_mapping
|
dict
|
用户不可指定 |
None
|
link_geo_mapping
|
dict
|
用户不可指定 |
None
|
ft_link_mapping
|
dict
|
用户不可指定 |
None
|
Source code in src/gotrackit/map/Net.py
50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 | |
Net类方法 - shortest_k_paths:
- 计算两个节点之间的K条最短路
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
o
|
int
|
起点节点 |
None
|
d
|
int
|
终点节点 |
None
|
k
|
int
|
路径数目 |
2
|
Returns:
| Type | Description |
|---|---|
list
|
list |
Source code in src/gotrackit/map/Net.py
930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 | |