[geos-devel] [GEOS] #383: error occur when buffer
GEOS
geos-trac at osgeo.org
Wed Nov 3 04:29:48 EDT 2010
#383: error occur when buffer
------------------------+---------------------------------------------------
Reporter: atubar | Owner: geos-devel@…
Type: defect | Status: new
Priority: major | Milestone: 3.2.1
Component: Default | Version: 3.2.0
Severity: Unassigned | Keywords:
------------------------+---------------------------------------------------
we debug the source code, and find that this function cause huge memory
cost, especially of the 'for' circulation.
void SegmentNodeList::addSplitEdges(std::vector<SegmentString*>& edgeList)
{
// testingOnly
#if GEOS_DEBUG
std::cerr<<__FUNCTION__<<" entered"<<std::endl;
std::vector<SegmentString*> testingSplitEdges;
#endif
// ensure that the list has entries for the first and last
// point of the edge
addEndpoints();
addCollapsedNodes();
// there should always be at least two entries in the list
// since the endpoints are nodes
iterator it=begin();
SegmentNode *eiPrev=*it;
assert(eiPrev);
it++;
//problem occurs here
for(iterator itEnd=end(); it!=itEnd; ++it)
{
//&&&&This circulation consumes lots of memory so as to run out of
the memory,then the program collapse
SegmentNode *ei=*it;
assert(ei);
if ( ! ei->compareTo(*eiPrev) ) continue;
SegmentString *newEdge=createSplitEdge(eiPrev, ei);
edgeList.push_back(newEdge);
#if GEOS_DEBUG
testingSplitEdges.push_back(newEdge);
#endif
eiPrev = ei;
}
#if GEOS_DEBUG
std::cerr<<__FUNCTION__<<" finished, now checking
correctness"<<std::endl;
checkSplitEdgesCorrectness(testingSplitEdges);
#endif
}
--
Ticket URL: <http://trac.osgeo.org/geos/ticket/383>
GEOS <http://geos.refractions.net/>
GEOS (Geometry Engine - Open Source) is a C++ port of the Java Topology Suite (JTS).
More information about the geos-devel
mailing list