[geos-devel] QuadEdgeSubdivision.cpp line 586. Is there anything wrong?
梁天辰
2284168009 at qq.com
Mon Mar 6 23:02:05 PST 2017
geos 3.5.0
i'm using geos to generate voronoi diagrams . i want to know each site i input into the function and its corresponding polygon.
here is the code according to page http://geos.osgeo.org/doxygen/classgeos_1_1triangulate_1_1quadedge_1_1QuadEdgeSubdivision.html#a3ee3bb33600640553458ba405e83f485
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();
const Polygon* p = dynamic_cast<const Polygon*>(polys->getGeometryN(i));
//ensure(p);
std::auto_ptr<CoordinateSequence> cs(
p->getExteriorRing()->getCoordinates()
);
size_t from = cs->size();
cs->removeRepeatedPoints();
//ensure_equals(from, cs->size());
}
coordinate of cordinate* c does not equal to any of my input sites.
so i feel in QuadEdgeSubdivision.cpp line 586, there should be some code passing a coordinate * variable to function setUserData using operator new.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/geos-devel/attachments/20170307/2e9130e3/attachment.html>
More information about the geos-devel
mailing list