Skip to content
Permalink
Browse files
Fix for ticket 1201, invalid split if line ends in polygon
git-svn-id: http://svn.osgeo.org/qgis/trunk@9490 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
mhugent committed Oct 17, 2008
1 parent 44ed7f9 commit 73c0a75436924f8b22f874fcbfe7f38438e21012
Showing with 17 additions and 1 deletion.
  1. +17 −1 src/core/qgsgeometry.cpp
@@ -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];

0 comments on commit 73c0a75

Please sign in to comment.