com.vividsolutions.jts.triangulate.quadedge.QuadEdgeSubdivision.getVoronoiCellPolygon()方法的使用及代码示例

x33g5p2x  于2022-01-28 转载在 其他  
字(2.3k)|赞(0)|评价(0)|浏览(79)

本文整理了Java中com.vividsolutions.jts.triangulate.quadedge.QuadEdgeSubdivision.getVoronoiCellPolygon方法的一些代码示例,展示了QuadEdgeSubdivision.getVoronoiCellPolygon的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。QuadEdgeSubdivision.getVoronoiCellPolygon方法的具体详情如下:
包路径:com.vividsolutions.jts.triangulate.quadedge.QuadEdgeSubdivision
类名称:QuadEdgeSubdivision
方法名:getVoronoiCellPolygon

QuadEdgeSubdivision.getVoronoiCellPolygon介绍

[英]Gets the Voronoi cell around a site specified by the origin of a QuadEdge.

The userData of the polygon is set to be the Coordinateof the site. This allows attaching external data associated with the site to this cell polygon.
[中]获取由四边形原点指定的站点周围的Voronoi单元格。
多边形的用户数据被设置为站点的坐标。这允许将与站点关联的外部数据附加到此单元多边形。

代码示例

代码示例来源:origin: com.vividsolutions/jts

/**
  * Gets a List of {@link Polygon}s for the Voronoi cells 
  * of this triangulation.
 * <p>
 * The userData of each polygon is set to be the {@link Coordinate}
 * of the cell site.  This allows easily associating external 
 * data associated with the sites to the cells.
  * 
  * @param geomFact a geometry factory
  * @return a List of Polygons
  */
public List getVoronoiCellPolygons(GeometryFactory geomFact)
{
  /*
   * Compute circumcentres of triangles as vertices for dual edges.
   * Precomputing the circumcentres is more efficient, 
   * and more importantly ensures that the computed centres
   * are consistent across the Voronoi cells.
   */ 
  visitTriangles(new TriangleCircumcentreVisitor(), true);
  
 List cells = new ArrayList();
 Collection edges = getVertexUniqueEdges(false);
 for (Iterator i = edges.iterator(); i.hasNext(); ) {
   QuadEdge qe = (QuadEdge) i.next();
  cells.add(getVoronoiCellPolygon(qe, geomFact));
 }
 return cells;
}

代码示例来源:origin: com.vividsolutions/jts-core

/**
  * Gets a List of {@link Polygon}s for the Voronoi cells 
  * of this triangulation.
 * <p>
 * The userData of each polygon is set to be the {@link Coordinate}
 * of the cell site.  This allows easily associating external 
 * data associated with the sites to the cells.
  * 
  * @param geomFact a geometry factory
  * @return a List of Polygons
  */
public List getVoronoiCellPolygons(GeometryFactory geomFact)
{
  /*
   * Compute circumcentres of triangles as vertices for dual edges.
   * Precomputing the circumcentres is more efficient, 
   * and more importantly ensures that the computed centres
   * are consistent across the Voronoi cells.
   */ 
  visitTriangles(new TriangleCircumcentreVisitor(), true);
  
 List cells = new ArrayList();
 Collection edges = getVertexUniqueEdges(false);
 for (Iterator i = edges.iterator(); i.hasNext(); ) {
   QuadEdge qe = (QuadEdge) i.next();
  cells.add(getVoronoiCellPolygon(qe, geomFact));
 }
 return cells;
}

相关文章