Skip to content

Commit

Permalink
gdalwarp -crop_to_cutline: relax epsilon to avoid extremely long loop (
Browse files Browse the repository at this point in the history
…fixes #4826)
  • Loading branch information
rouault committed Nov 14, 2021
1 parent 3c11b98 commit 784a426
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion apps/gdalwarp_lib.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -451,7 +451,9 @@ static CPLErr CropToCutline( OGRGeometryH hCutline, char** papszTO,
if( hCTCutlineToSrc != nullptr )
OGR_G_Transform( hGeomInSrcSRS, hCTCutlineToSrc );

const double epsilon = std::numeric_limits<double>::epsilon();
// Do not use a smaller epsilon, otherwise it could cause useless
// segmentization (https://github.com/OSGeo/gdal/issues/4826)
constexpr double epsilon = 1e-10;
for(int nIter=0;nIter<10;nIter++)
{
OGR_G_DestroyGeometry(hTransformedGeom);
Expand Down

0 comments on commit 784a426

Please sign in to comment.