# Transform - Geometry: Voronoi

The Voronoi template appears in the template list when a geometry field, of type geom, geommfd, or geomwkb, has been picked in the Transform pane.   It creates Voronoi diagrams.    To create a Voronoi diagram for polygonal areas, see the Example: Voronoi Diagram from Areas  topic.

 Voronoi Create areas or lines as specified in the Output type box that create a Voronoi diagram drawn with areas, lines, or points for the positions of points in the source geometry field.  Areas and lines are ignored.      Output types:   area - create a Voronoi diagram as areas from the set of source points. line - create a Voronoi diagram as lines from the set of source points. point - create points at the vertices that define a Voronoi diagram created as lines from the set of source points.   A Voronoi diagram divides the drawing into regions around each point that are shaped so that the borders of the regions are equidistant from the two nearest points.   The Margin setting allows choosing a Margin distance in X and Y directions in the specified unit of measure from the nearest points, to clips the extent of Voronoi cells to the resulting enclosing rectangle.  The Unit setting allows choosing a unit of measure.   Launch the template by choosing a geometry field and then double-clicking the Voronoi template.  When the template launches we can specify options. Voronoi : area Given a drawing of points, create a drawing of area objects such that the areas create a Voronoi diagram for the positions of the original points.   A Voronoi diagram divides the drawing into regions around each point that are shaped so that the borders of the regions are equidistant from the two nearest points.   We use an example drawing containing points. With the focus on the drawing, in the Transform pane we choose the Geom field and then we choose the Voronoi template. In the Voronoi template we choose the area operation, using 50 for the Margin value and Meter for the Unit of measure.   We choose New Table and specify Points voronoi areas for the name of the new drawing and an analogous name for the new table.   Press Transform.   A new Points voronoi areas drawing and table appears in the Project pane.  We drag and drop the new Points voronoi areas drawing as a layer into the Points Drawing window. The new Points voronoi areas drawings shows how the system has generated Voronoi areas around each point.  The Margin setting clips the extent of the outermost areas to a rectangular region with horizontal and vertical borders no further than 50 meters from the outermost points, which prevents infinite areas from being generated.     See the Voronoi Diagrams topic for a discussion of options. Voronoi : line Given a drawing of points, create a drawing of line objects such that the lines form the boundaries in a Voronoi diagram for the positions of the original points.   A Voronoi diagram divides the drawing into regions around each point that are shaped so that the borders of the regions are equidistant from the two nearest points.   We use an example drawing containing points. With the focus on the drawing, in the Transform pane we choose the Geom field and then we choose the Voronoi template. In the Voronoi template we choose the line operation, using 50 for the Margin value and Meter for the Unit of measure.   We choose New Table and specify Points voronoi lines for the name of the new drawing and an analogous name for the new table.   Press Transform.   A new Points voronoi lines drawing and table appears in the Project pane.  We drag and drop the new Points voronoi lines drawing as a layer into the Points Drawing window. The new Points voronoi lines drawings shows how the system has generated border lines for Voronoi regions around each point.  The Margin setting clips the extent of the outermost regions to a rectangular region with horizontal and vertical borders no further than 50 meters from the outermost points, which prevents infinite regions from being generated.   See the Voronoi Diagrams topic for a discussion of options. Voronoi : point Given a drawing of points, create a Voronoi diagram of boundary lines and then create point objects at the location of each coordinate that defines a boundary line.     A Voronoi diagram divides the drawing into regions around each point that are shaped so that the borders of the regions are equidistant from the two nearest points.   This option is rarely used, since the visual difference between the new set of Voronoi points and the original points from which the Voronoi diagram is constructed tends to be confusing.   We use an example drawing containing points. With the focus on the drawing, in the Transform pane we choose the Geom field and then we choose the Voronoi template. In the Voronoi template we choose the point operation, using 50 for the Margin value and Meter for the Unit of measure.   We choose New Table and specify Points voronoi points for the name of the new drawing and an analogous name for the new table.   Press Transform.   A new Points voronoi points drawing and table appears in the Project pane.  We drag and drop the new Points voronoi points drawing as a layer into the Points Drawing window.     We also drag and drop a Points voronoi lines drawing created using the Voronoi : line option to provide visual context to better understand the Voronoi points drawing. The illustration above shows the original Points Drawing, shown with 50% opacity set in the Layers pane.  Above that we see the Points voronoi lines drawing, also shown with 50% opacity.   Finally, in bright magenta color we see the Points voronoi points drawing containing the Voronoi points we have just created.   The Voronoi lines form the boundary lines between Voronoi regions about each of the original points.   At each vertex that defines a boundary line, the point operation has created a Voronoi point.     As with the area and line options for the Voronoi template, the Margin setting clips the extent of the outermost regions to a rectangular region with horizontal and vertical borders no further than 50 meters from the outermost points, which prevents infinite regions from being generated.   See the Voronoi Diagrams topic for a discussion of options.

## Notes

Curvilinear segments - As a practical matter, most people doing GIS will use straight line segments for lines and areas.   Few GIS systems do a good job of supporting curved segments, so there is much less data published using curved segments.   Manifold's ability to work with curved segments allows us to use that data within Manifold in a limited way, at least for display and interactive editing.

However, most processing tools in Manifold, such as Transform templates and various Geom SQL functions, do their work by first converting a curvilinear segment into a straight line segment between the same two start and finish coordinates.  That will often lead to weird or otherwise unexpected results.  To avoid such problems, first convert curvilinear segments into equivalent constellations of straight line segments at whatever resolution is desired, using the transform template with the convert curves to lines operation option and the number of linear segments desired to approximate the curve in the Curve limit parameter.   See the Curved Segments discussion in the Drawings topic.

Transform Pane

Transform Reference

Transform - Geometry

Transform - Geometry: Triangulate

Transform - Geometry: Voronoi

Voronoi Diagrams

Example: Voronoi Diagram from Areas - Voronoi diagrams are normally created from points.  This example shows how to create a Voronoi diagram for polygonal areas, so that every location in a given cell in the Voronoi diagram shows which area is the closest to that location.