Skip to content
Permalink
Browse files

Catch nans and infs in clipper. Fixes #3081

git-svn-id: http://svn.osgeo.org/qgis/trunk@14554 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
mhugent
mhugent committed Nov 12, 2010
1 parent 06305bc commit 358e4349b936c9cba9ed20a3cbc1128627a38f54
Showing with 12 additions and 1 deletion.
  1. +12 −1 src/core/qgsclipper.h
@@ -154,7 +154,18 @@ inline void QgsClipper::trimFeatureToBoundary(

// and compare to the first point initially.
for ( unsigned int i2 = 0; i2 < inX.size() ; ++i2 )
{ // look at each edge of the polygon in turn
{
// look at each edge of the polygon in turn

//ignore segments with nan or inf coordinates
if ( isnan( inX[i2] ) || isnan( inY[i2] ) || isinf( inX[i2] ) || isinf( inY[i2] )
|| isnan( inX[i1] ) || isnan( inY[i1] ) || isinf( inX[i1] ) || isinf( inY[i1] ) )
{
i1 = i2;
continue;
}


if ( inside( inX[i2], inY[i2], b ) ) // end point of edge is inside boundary
{
if ( inside( inX[i1], inY[i1], b ) )

0 comments on commit 358e434

Please sign in to comment.
You can’t perform that action at this time.