[geos-devel] how to Get the cells in the Voronoi diagram and the Coordinate of the cell site using geos?thanks.

梁天辰 2284168009 at qq.com
Thu Mar 16 17:45:44 PDT 2017


i'm using geos c++ interface.

i need  to Gets the cells in the Voronoi diagram and  the Coordinate of the cell site. 

here is the code:

 std::auto_ptr<GeometryCollection> polys = subdiv->getVoronoiDiagram(geomFact);
 for (std::size_t i = 0; i < polys->getNumGeometries(); ++i)

 {
  Coordinate *c = (Coordinate*)((Geometry*)(polys->getGeometryN(i)))->getUserData(); 

 }

but the Coordinate of coordinate* c does not equal to any of my input sites.

am i using the c++ api in the wrong way?please help me correct my mistakes.

temporarily,i modified  geos-3.6.1\src\triangulate\quadedge\QuadEdgeSubdivision.cpp line 586 to

	cellPoly->setUserData(reinterpret_cast<void*>(geomFact.createPoint(c)));
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/geos-devel/attachments/20170317/298d59b9/attachment.html>


More information about the geos-devel mailing list