Skip to content
Permalink
Browse files

Fix for reshape of multilines

git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@11505 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
mhugent
mhugent committed Aug 26, 2009
1 parent 8b096ec commit 8cecff25421595f9d7201a6e526db66483db34c2
Showing with 17 additions and 2 deletions.
  1. +17 −2 src/core/qgsgeometry.cpp
@@ -3243,7 +3243,13 @@ int QgsGeometry::reshapeGeometry( const QList<QgsPoint>& reshapeWithLine )
return 1;
}

bool isMultiGeom = ( numGeoms > 1 );
bool isMultiGeom = false;
int geosTypeId = GEOSGeomTypeId( mGeos );
if ( geosTypeId == GEOS_MULTILINESTRING || geosTypeId == GEOS_MULTIPOLYGON )
{
isMultiGeom = true;
}

bool isLine = ( type() == QGis::Line );

//polygon or multipolygon?
@@ -3303,7 +3309,16 @@ int QgsGeometry::reshapeGeometry( const QList<QgsPoint>& reshapeWithLine )
}
GEOSGeom_destroy( reshapeLineGeos );

GEOSGeometry* newMultiGeom = GEOSGeom_createCollection( GEOS_MULTIPOLYGON, newGeoms, numGeoms );
GEOSGeometry* newMultiGeom = 0;
if ( isLine )
{
newMultiGeom = GEOSGeom_createCollection( GEOS_MULTILINESTRING, newGeoms, numGeoms );
}
else //multipolygon
{
newMultiGeom = GEOSGeom_createCollection( GEOS_MULTIPOLYGON, newGeoms, numGeoms );
}

delete[] newGeoms;
if ( ! newMultiGeom )
{

0 comments on commit 8cecff2

Please sign in to comment.
You can’t perform that action at this time.