mirror of
https://github.com/qgis/QGIS.git
synced 2025-02-25 00:58:06 -05:00
Fix for reshape of multilines
git-svn-id: http://svn.osgeo.org/qgis/trunk@11505 c8812cc2-4d05-0410-92ff-de0c093fc19c
This commit is contained in:
parent
b17898e292
commit
8cd89f63f1
@ -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 )
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user