本文整理了Java中com.vividsolutions.jts.triangulate.quadedge.QuadEdgeSubdivision.getVoronoiCellPolygon
方法的一些代码示例,展示了QuadEdgeSubdivision.getVoronoiCellPolygon
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。QuadEdgeSubdivision.getVoronoiCellPolygon
方法的具体详情如下:
包路径:com.vividsolutions.jts.triangulate.quadedge.QuadEdgeSubdivision
类名称: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;
}
内容来源于网络,如有侵权,请联系作者删除!