Skip to content

Commit 178065b

Browse files
author
mhugent
committed
Fix for reshape problem with closed lines
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@11807 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent 50e9f9f commit 178065b

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

src/core/qgsgeometry.cpp

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5181,13 +5181,6 @@ GEOSGeometry* QgsGeometry::reshapeLine( const GEOSGeometry* line, const GEOSGeom
51815181
return 0;
51825182
}
51835183

5184-
5185-
bool isRing = false;
5186-
if ( GEOSGeomTypeId( line ) == GEOS_LINEARRING )
5187-
{
5188-
isRing = true;
5189-
}
5190-
51915184
//begin and end point of original line
51925185
const GEOSCoordSequence* lineCoordSeq = GEOSGeom_getCoordSeq( line );
51935186
if ( !lineCoordSeq )
@@ -5212,6 +5205,12 @@ GEOSGeometry* QgsGeometry::reshapeLine( const GEOSGeometry* line, const GEOSGeom
52125205
GEOSGeometry* beginLineVertex = createGeosPoint( QgsPoint( x1, y1 ) );
52135206
GEOSGeometry* endLineVertex = createGeosPoint( QgsPoint( x2, y2 ) );
52145207

5208+
bool isRing = false;
5209+
if ( GEOSGeomTypeId( line ) == GEOS_LINEARRING || GEOSEquals( beginLineVertex, endLineVertex ) == 1 )
5210+
{
5211+
isRing = true;
5212+
}
5213+
52155214
//node line and reshape line
52165215
GEOSGeometry* nodedGeometry = nodeGeometries( reshapeLineGeos, line );
52175216
if ( !nodedGeometry )

0 commit comments

Comments
 (0)