Opened 7 weeks ago

Closed 6 weeks ago

Last modified 6 weeks ago

#7119 closed defect (fixed)

gdalwarp: -crop_to_cutline floats comparison

Reported by: nemq Owned by: warmerdam
Priority: normal Milestone: 2.2.3
Component: default Version: 2.2.2
Severity: minor Keywords: gdalwarp
Cc:

Description

When using gdalwarp utility with -cutline -crop_to_cutline and reprojection it sometimes happens that for similarly sized data process takes enormously greater amount of time. Issue is caused by direct comparison of floats in gdalwarp_lib.cpp CropToCutline? function (diff in atachment). For some unfortunate values condition will never be met resulting in full ten iterations of algorithm. Proposed solution is based on: http://en.cppreference.com/w/cpp/types/numeric_limits/epsilon

Attachments (2)

gdalwarp_lib.patch (1.5 KB) - added by nemq 7 weeks ago.
sample.7z (22.1 KB) - added by nemq 7 weeks ago.

Download all attachments as: .zip

Change History (6)

Changed 7 weeks ago by nemq

Attachment: gdalwarp_lib.patch added

Changed 7 weeks ago by nemq

Attachment: sample.7z added

comment:1 Changed 6 weeks ago by Jukka Rahkonen

Summary: gdalwarp: -crop_tu_cutline floats comparisongdalwarp: -crop_to_cutline floats comparison

comment:2 Changed 6 weeks ago by Even Rouault

Resolution: fixed
Status: newclosed

In 40600:

gdalwarp -crop_to_cutline: reduce number of iterations to find the appropriate densification (patch by nemq, fixes #7119)

comment:3 Changed 6 weeks ago by Even Rouault

In 40601:

gdalwarp -crop_to_cutline: reduce number of iterations to find the appropriate densification (patch by nemq, fixes #7119)

comment:4 Changed 6 weeks ago by Even Rouault

Milestone: 2.2.3
Note: See TracTickets for help on using tickets.