VoronoiDiagram¶
Creates the Voronoi diagram, or the Thiessen polygons, of a set of points: around each point, the cell of the places closer to it than to any other point, with the attributes of the point. It gives the area of influence of each point, as the area of each rain gauge in the Thiessen method for the mean rainfall of a basin.
Details¶
Each cell takes the attributes of its point, so the diagram gives the area of influence of each point, as in the Thiessen method for the mean rainfall from the rain gauges. The cells are the dual of the Delaunay triangulation: their borders are the axes of the sides of the triangles.
The outer cells are open on one side, so the diagram is cut on a rectangle larger than the points: their bounds, enlarged on each side by their diagonal. Points in the same position get one cell, with the attributes of the first of them.
Parameters¶
Creates the Voronoi diagram, or Thiessen polygons, of a set of points: around each point, the cell of the places closer to it than to any other point.
Toolbox folder: Vector Processing
Status: Certified
Keywords: vector, voronoi, thiessen
Authors: Andrea Antonello, Silvia Franceschi
Class: org.hortonmachine.modules.VoronoiDiagram
Inputs
Parameter |
Type |
Unit |
Default |
Description |
|---|---|---|---|---|
|
vector file |
The input points map. |
Outputs
Parameter |
Type |
Unit |
Description |
|---|---|---|---|
|
output file |
The output voronoi map, with the attributes of the points. |
Example¶
The example makes the cells of the centroids of the sub-basins of the DelaunayTriangulation example:
import org.hortonmachine.modules.VoronoiDiagram
// the folder with the elevation model: change it to yours
var folder = "/data/flanginec/"
var voronoi = new VoronoiDiagram()
// the centroids of the sub-basins, of the DelaunayTriangulation example
voronoi.inMap = folder + "subbasins_centroids.shp"
voronoi.outMap = folder + "voronoi.shp"
voronoi.process()
The 99 cells, colored by the mean elevation of their sub-basin, with the centroids in blue. The outer cells reach the cut rectangle of the diagram, beyond the map: