spaghetti.Network.distancebandweights

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

Create distance based weights.

Parameters
thresholdfloat

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_treebool

Rebuild shortest path with True, or skip with False.

Returns
wlibpysal.weights.weights.W

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

Examples

>>> import 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]
(8, 3)