pysal.explore.spaghetti.Network.distancebandweights

Network.distancebandweights(threshold, n_proccess=None, gen_tree=False)[source]

Create distance based weights.

Parameters:
threshold : float

Distance threshold value.

n_processes : int, str

(Optional) Specify the number of cores to utilize. Default is 1 core. Use (int) to specify an exact number or cores. Use (“all”) to request all available cores.

gen_tree : bool

rebuild shortest path {True}, or skip {False}

Returns:
w : pysal.lib.weights.weights.W

A PySAL W Object representing the binary adjacency of the network.

Examples

>>> 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)]