Navigation Menu

Skip to content

Commit

Permalink
more robust line/multiline splitting
Browse files Browse the repository at this point in the history
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 8485f0b
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/core/qgsgeometry.cpp
Expand Up @@ -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]);
}
Expand Down

0 comments on commit 8485f0b

Please sign in to comment.