Skip to content

Commit

Permalink
Fix for reshape problem with closed lines
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@11807 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
mhugent committed Oct 15, 2009
1 parent 50e9f9f commit 178065b
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions src/core/qgsgeometry.cpp
Expand Up @@ -5181,13 +5181,6 @@ GEOSGeometry* QgsGeometry::reshapeLine( const GEOSGeometry* line, const GEOSGeom
return 0; return 0;
} }



bool isRing = false;
if ( GEOSGeomTypeId( line ) == GEOS_LINEARRING )
{
isRing = true;
}

//begin and end point of original line //begin and end point of original line
const GEOSCoordSequence* lineCoordSeq = GEOSGeom_getCoordSeq( line ); const GEOSCoordSequence* lineCoordSeq = GEOSGeom_getCoordSeq( line );
if ( !lineCoordSeq ) if ( !lineCoordSeq )
Expand All @@ -5212,6 +5205,12 @@ GEOSGeometry* QgsGeometry::reshapeLine( const GEOSGeometry* line, const GEOSGeom
GEOSGeometry* beginLineVertex = createGeosPoint( QgsPoint( x1, y1 ) ); GEOSGeometry* beginLineVertex = createGeosPoint( QgsPoint( x1, y1 ) );
GEOSGeometry* endLineVertex = createGeosPoint( QgsPoint( x2, y2 ) ); 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 //node line and reshape line
GEOSGeometry* nodedGeometry = nodeGeometries( reshapeLineGeos, line ); GEOSGeometry* nodedGeometry = nodeGeometries( reshapeLineGeos, line );
if ( !nodedGeometry ) if ( !nodedGeometry )
Expand Down

0 comments on commit 178065b

Please sign in to comment.