Skip to content
Permalink
Browse files

Fix for reshape of multilines

git-svn-id: http://svn.osgeo.org/qgis/trunk@11505 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
mhugent
mhugent committed Aug 26, 2009
1 parent b17898e commit 8cd89f63f18adf13803275acb39c9c41de3c2e02
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 8cd89f6

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