Skip to content
Permalink
Browse files
more robust line/multiline splitting
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@8095 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
mhugent committed Jan 30, 2008
1 parent a49dac5 commit 8485f0b3cad02110741ed32709bc33a49bf9e8d9
Showing with 6 additions and 2 deletions.
  1. +6 −2 src/core/qgsgeometry.cpp
@@ -4576,10 +4576,14 @@ int QgsGeometry::splitLinearGeometry(GEOS_GEOM::LineString* splitLine, QList<Qgs
QList<GEOS_GEOM::Geometry*> testedGeometries;
GEOS_GEOM::Geometry* intersectGeom = 0;

//hardcoded thresholds
double bufferDistance = 0.000000001;
double intersectThreshold = 0.0000001;

for(unsigned int i = 0; i < mergedLineStrings->size(); ++i)
{
intersectGeom = mGeos->intersection((*mergedLineStrings)[i]);
if(intersectGeom->getLength() > 0.00000001)
intersectGeom = mGeos->intersection((*mergedLineStrings)[i]->buffer(bufferDistance));
if(intersectGeom->getLength() > intersectThreshold)
{
testedGeometries.push_back((*mergedLineStrings)[i]);
}

0 comments on commit 8485f0b

Please sign in to comment.