[geos-commits] r3184 - trunk/src/operation/union

svn_geos at osgeo.org svn_geos at osgeo.org
Fri Feb 4 07:27:02 EST 2011


Author: strk
Date: 2011-02-04 04:27:01 -0800 (Fri, 04 Feb 2011)
New Revision: 3184

Modified:
   trunk/src/operation/union/CascadedPolygonUnion.cpp
Log:
dynamic_cast Polygon to Geometry before converting to void pointer. This is safer, altought the whole void pointer use should be dropped for real safety.

Modified: trunk/src/operation/union/CascadedPolygonUnion.cpp
===================================================================
--- trunk/src/operation/union/CascadedPolygonUnion.cpp	2011-02-04 12:26:53 UTC (rev 3183)
+++ trunk/src/operation/union/CascadedPolygonUnion.cpp	2011-02-04 12:27:01 UTC (rev 3184)
@@ -78,7 +78,8 @@
     typedef std::vector<geom::Polygon*>::iterator iterator_type;
     iterator_type end = inputPolys->end();
     for (iterator_type i = inputPolys->begin(); i != end; ++i) {
-        index.insert((*i)->getEnvelopeInternal(), *i);
+        geom::Geometry* g = dynamic_cast<geom::Geometry*>(*i);
+        index.insert(g->getEnvelopeInternal(), g);
     }
 
     std::auto_ptr<index::strtree::ItemsList> itemTree (index.itemsTree());



More information about the geos-commits mailing list