Opened 5 years ago

Closed 5 years ago

Last modified 5 years 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 5 years ago.
sample.7z (22.1 KB ) - added by nemq 5 years ago.

Download all attachments as: .zip

Change History (6)

by nemq, 5 years ago

Attachment: gdalwarp_lib.patch added

by nemq, 5 years ago

Attachment: sample.7z added

comment:1 by Jukka Rahkonen, 5 years ago

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

comment:2 by Even Rouault, 5 years ago

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 by Even Rouault, 5 years ago

In 40601:

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

comment:4 by Even Rouault, 5 years ago

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