Skip to content

Commit

Permalink
Catch nans and infs in clipper. Fixes #3081
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.osgeo.org/qgis/trunk@14554 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
mhugent committed Nov 12, 2010
1 parent 06305bc commit 358e434
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/core/qgsclipper.h
Expand Up @@ -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 ) )
Expand Down

0 comments on commit 358e434

Please sign in to comment.