diff --git a/GeoLib/SimplePolygonTree.cpp b/GeoLib/SimplePolygonTree.cpp index 8065a57fd009dcfdfbcd642ad59b32a2aa06b382..0c6796cdfb051aee649e4118a54fbfcc2e08d4f5 100644 --- a/GeoLib/SimplePolygonTree.cpp +++ b/GeoLib/SimplePolygonTree.cpp @@ -52,15 +52,7 @@ void SimplePolygonTree::insertSimplePolygonTree (SimplePolygonTree* polygon_hier bool nfound (true); for (std::list<SimplePolygonTree*>::const_iterator it (_childs.begin()); it != _childs.end() && nfound; ++it) { - // check all points of polygon - size_t n_pnts_polygon (polygon->getNumberOfPoints()), cnt(0); - for (size_t k(0); k < n_pnts_polygon && cnt == k; k++) { - if (((*it)->getPolygon())->isPntInPolygon (*(polygon->getPoint(k)))) { - cnt++; - } - } - // all points of the given polygon are contained in the current polygon - if (cnt == n_pnts_polygon) { + if (((*it)->getPolygon())->isPolylineInPolygon (*(polygon))) { (*it)->insertSimplePolygonTree (polygon_hierarchy); nfound = false; }