[geos-commits] r3327 - trunk/src/geomgraph

svn_geos at osgeo.org svn_geos at osgeo.org
Fri May 6 04:57:22 EDT 2011


Author: strk
Date: 2011-05-06 01:57:22 -0700 (Fri, 06 May 2011)
New Revision: 3327

Modified:
   trunk/src/geomgraph/GeometryGraph.cpp
Log:
Use logical (not bitwise) AND, use dynamic_cast to map JTS's instanceof operator

Modified: trunk/src/geomgraph/GeometryGraph.cpp
===================================================================
--- trunk/src/geomgraph/GeometryGraph.cpp	2011-05-06 08:57:15 UTC (rev 3326)
+++ trunk/src/geomgraph/GeometryGraph.cpp	2011-05-06 08:57:22 UTC (rev 3327)
@@ -349,13 +349,13 @@
 {
 	SegmentIntersector *si=new SegmentIntersector(li,true,false);
     	auto_ptr<EdgeSetIntersector> esi(createEdgeSetIntersector());
+
 	// optimized test for Polygons and Rings
-	if (parentGeom==NULL)
+	if (! computeRingSelfNodes
+	    && ( dynamic_cast<const LinearRing*>(parentGeom)
+	    || dynamic_cast<const Polygon*>(parentGeom)
+	    || dynamic_cast<const MultiPolygon*>(parentGeom) ))
 	{
-		esi->computeIntersections(edges,si,true);
-	}
-	else if (!computeRingSelfNodes & (typeid(*parentGeom)==typeid(LinearRing)||typeid(*parentGeom)==typeid(Polygon)||typeid(*parentGeom)==typeid(MultiPolygon)))
-	{
 		esi->computeIntersections(edges, si, false);
 	}
 	else



More information about the geos-commits mailing list