[QGIS Commit] r11807 - trunk/qgis/src/core

svn_qgis at osgeo.org svn_qgis at osgeo.org
Thu Oct 15 04:17:01 EDT 2009


Author: mhugent
Date: 2009-10-15 04:16:59 -0400 (Thu, 15 Oct 2009)
New Revision: 11807

Modified:
   trunk/qgis/src/core/qgsgeometry.cpp
Log:
Fix for reshape problem with closed lines

Modified: trunk/qgis/src/core/qgsgeometry.cpp
===================================================================
--- trunk/qgis/src/core/qgsgeometry.cpp	2009-10-14 13:31:41 UTC (rev 11806)
+++ trunk/qgis/src/core/qgsgeometry.cpp	2009-10-15 08:16:59 UTC (rev 11807)
@@ -5181,13 +5181,6 @@
     return 0;
   }
 
-
-  bool isRing = false;
-  if ( GEOSGeomTypeId( line ) == GEOS_LINEARRING )
-  {
-    isRing = true;
-  }
-
   //begin and end point of original line
   const GEOSCoordSequence* lineCoordSeq = GEOSGeom_getCoordSeq( line );
   if ( !lineCoordSeq )
@@ -5212,6 +5205,12 @@
   GEOSGeometry* beginLineVertex = createGeosPoint( QgsPoint( x1, y1 ) );
   GEOSGeometry* endLineVertex = createGeosPoint( QgsPoint( x2, y2 ) );
 
+  bool isRing = false;
+  if ( GEOSGeomTypeId( line ) == GEOS_LINEARRING || GEOSEquals( beginLineVertex, endLineVertex ) == 1 )
+  {
+    isRing = true;
+  }
+
 //node line and reshape line
   GEOSGeometry* nodedGeometry = nodeGeometries( reshapeLineGeos, line );
   if ( !nodedGeometry )



More information about the QGIS-commit mailing list