From 178065b5bb2864ac421d289756a5ecff431238e0 Mon Sep 17 00:00:00 2001 From: mhugent Date: Thu, 15 Oct 2009 08:16:59 +0000 Subject: [PATCH] Fix for reshape problem with closed lines git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@11807 c8812cc2-4d05-0410-92ff-de0c093fc19c --- src/core/qgsgeometry.cpp | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/core/qgsgeometry.cpp b/src/core/qgsgeometry.cpp index 2dbcf4b3d7f5..ea207e1612cb 100644 --- a/src/core/qgsgeometry.cpp +++ b/src/core/qgsgeometry.cpp @@ -5181,13 +5181,6 @@ GEOSGeometry* QgsGeometry::reshapeLine( const GEOSGeometry* line, const GEOSGeom 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* QgsGeometry::reshapeLine( const GEOSGeometry* line, const GEOSGeom 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 )