Generate spatial weights based on Queen or Rook contiguity of order k.
Adjacent are all features within <= k steps. Pass either gdf or weights.
If both are passed, weights is used.
If weights are passed, contiguity is
ignored and high order spatial weights based on weights are computed.
order of contiguity
GeoDataFrame containing objects to analyse. Index has to be
consecutive range 0:x.
Otherwise, spatial weights will not match objects.
libpysal.weights of order 1
type of contiguity weights. Can be 'queen' or 'rook'.
silence libpysal islands warnings
>>> first_order = libpysal.weights.Queen.from_dataframe(geodataframe)
>>> fourth_order = sw_high(k=4, gdf=geodataframe)