Skip to content

Commit 8485f0b

Browse files
author
mhugent
committed
more robust line/multiline splitting
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@8095 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent a49dac5 commit 8485f0b

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/core/qgsgeometry.cpp

+6-2
Original file line numberDiff line numberDiff line change
@@ -4576,10 +4576,14 @@ int QgsGeometry::splitLinearGeometry(GEOS_GEOM::LineString* splitLine, QList<Qgs
45764576
QList<GEOS_GEOM::Geometry*> testedGeometries;
45774577
GEOS_GEOM::Geometry* intersectGeom = 0;
45784578

4579+
//hardcoded thresholds
4580+
double bufferDistance = 0.000000001;
4581+
double intersectThreshold = 0.0000001;
4582+
45794583
for(unsigned int i = 0; i < mergedLineStrings->size(); ++i)
45804584
{
4581-
intersectGeom = mGeos->intersection((*mergedLineStrings)[i]);
4582-
if(intersectGeom->getLength() > 0.00000001)
4585+
intersectGeom = mGeos->intersection((*mergedLineStrings)[i]->buffer(bufferDistance));
4586+
if(intersectGeom->getLength() > intersectThreshold)
45834587
{
45844588
testedGeometries.push_back((*mergedLineStrings)[i]);
45854589
}

0 commit comments

Comments
 (0)