Skip to content

Commit

Permalink
Fix for ticket 1201, invalid split if line ends in polygon
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@9490 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
mhugent committed Oct 17, 2008
1 parent 804d679 commit e7d3f17
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion src/core/qgsgeometry.cpp
Expand Up @@ -4882,9 +4882,25 @@ int QgsGeometry::splitPolygonGeometry( GEOSGeometry* splitLine, QList<QgsGeometr
GEOSGeom_destroy( intersectGeometry );
}

bool splitDone = true;
int nGeometriesThis = GEOSGetNumGeometries(mGeos); //original number of geometries
if(testedGeometries.size() == nGeometriesThis)
{
splitDone = false;
}

mergeGeometriesMultiTypeSplit( testedGeometries );

if ( testedGeometries.size() > 0 )
//no split done, preserve original geometry
if(!splitDone)
{
for(int i = 0; i < testedGeometries.size(); ++i)
{
GEOSGeom_destroy(testedGeometries[i]);
}
return 1;
}
else if(testedGeometries.size() > 0) //split successfull
{
GEOSGeom_destroy( mGeos );
mGeos = testedGeometries[0];
Expand Down

0 comments on commit e7d3f17

Please sign in to comment.