pysal.explore.spaghetti.Network.distancebandweights

Network.distancebandweights(threshold, n_proccess=None, gen_tree=False)[源代码]

创建基于距离的权重。

参数:
门槛 : 浮动

距离阈值。

n_processes : 内部,结构

(可选)指定要使用的内核数。默认值为1核心。使用(int)指定一个确切的数字或核心。使用(“all”)请求所有可用的核心。

gen_tree : 布尔

重建最短路径真,或跳过假

返回:
w : pysal.lib.weights.weights.W

表示网络二进制邻接的Pysal W对象。

实例

>>> import pysal.explore.spaghetti as spgh
>>> streets_file = examples.get_path('streets.shp')
>>> ntw = spgh.Network(in_data=streets_file)
>>> w = ntw.distancebandweights(threshold=500)
>>> w.n
230
>>> w.histogram
[(1, 22), (2, 58), (3, 63), (4, 40), (5, 36), (6, 3), (7, 5), (8, 3)]