libpysal.weights.
Voronoi
(points, criterion='rook', clip='ahull', **kwargs)[source]¶Voronoi weights for a 2-d point set
Points are Voronoi neighbors if their polygons share an edge or vertex.
Parameters: |
|
---|---|
Returns: |
|
Examples
>>> import numpy as np
>>> from libpysal.weights import Voronoi
>>> np.random.seed(12345)
>>> points= np.random.random((5,2))*10 + 10
>>> w = Voronoi(points)
>>> w.neighbors
{0: [2, 3, 4], 1: [2], 2: [0, 1, 4], 3: [0, 4], 4: [0, 2, 3]}