momepy.
DistanceBand
On demand distance-based spatial weights-like class.
Mimic the behavior of libpysal.weights.DistanceBand but do not compute all neighbors at once but only on demand. Only DistanceBand.neighbors[key] is implemented. Once user asks for DistanceBand.neighbors[key], neighbors for specified key will be computed using rtree. The algorithm is significantly slower than libpysal.weights.DistanceBand but allows for large number of neighbors which may cause memory issues in libpysal.
libpysal.weights.DistanceBand
DistanceBand.neighbors[key]
Use libpysal.weights.DistanceBand if possible. momepy.weights.DistanceBand only when necessary. DistanceBand.neighbors[key] should yield same results as momepy.DistanceBand.
momepy.weights.DistanceBand
momepy.DistanceBand
GeoDataFrame containing objects to be used
distance band to be used as buffer
use centroid of geometry (as in libpysal.weights.DistanceBand). If False, works with the geometry as it is.
False
column to be used as geometry ids. If not set, integer position is used.
list of ids of neighboring features
Methods
fetch_items
__init__
Initialize self. See help(type(self)) for accurate signature.
__init__(gdf, threshold[, centroid, ids])
Initialize self.
fetch_items(key)