Opened 8 years ago

Closed 5 years ago

#6507 closed defect (wontfix)

after updating to 2.1.0, gdalwarp takes forever to complete

Reported by: dsogari Owned by: warmerdam
Priority: high Milestone: closed_because_of_github_migration
Component: default Version: 2.1.0
Severity: normal Keywords: gdalwarp cutline blend
Cc:

Description

The following command executes flawlessly using GDAL 2.0.2:

gdalwarp -of GTiff -cutline polygon.kml -crop_to_cutline -wo CUTLINE_ALL_TOUCHED=TRUE -wo CUTLINE_BLEND_DIST=1 map.tiff map_out.tiff

However, when executed in GDAL 2.1.0, it takes forever to complete.

I investigated the code and discovered it has something to do with the blend distance option. There is a loop inside the BlendMaskGenerator function in gdalcutline.cpp. This loop is executed very quickly in GDAL 2.0.2, but takes too long in 2.1.0.

For the life of me I can't figure out why. I just know that compiling the previous code of the gdalwarp utility with the 2.1.0 version of the lib does not trigger the issue.

The sample input files are attached. Please tell us if you experience the same issue and help us. We are almost done migrating our codebase.

Thank you in advance

Attachments (1)

polygon.kml (458 bytes ) - added by dsogari 8 years ago.
input cutline

Download all attachments as: .zip

Change History (6)

by dsogari, 8 years ago

Attachment: polygon.kml added

input cutline

comment:1 by dsogari, 8 years ago

Sorry, the input raster is too big. I'll upload it to a server and then post the link here.

comment:2 by dsogari, 8 years ago

The link for the sample input raster: http://inf.ufrgs.br/~dsogari/map.tiff

comment:3 by Even Rouault, 8 years ago

trunk r34209, branches/2.1 r34210 "gdalwarp: do not densify cutlines by default when CUTLINE_BLEND_DIST is used (#6507)"

You can workaround the issue by defining the configuration option/environment variable GDALWARP_DENSIFY_CUTLINE=NO. The issue only happens when CUTLINE_BLEND_DIST is used

A better fix, but more involved, would be to try improving BlendMaskGenerator() in apps/gdalwarp_lib.cpp to avoid as many point-to-polygon distance computations.

comment:4 by dsogari, 8 years ago

Thanks! This workaround will suffice for us.

comment:5 by Even Rouault, 5 years ago

Milestone: closed_because_of_github_migration
Resolution: wontfix
Status: newclosed

This ticket has been automatically closed because Trac is no longer used for GDAL bug tracking, since the project has migrated to GitHub. If you believe this ticket is still valid, you may file it to https://github.com/OSGeo/gdal/issues if it is not already reported there.

Note: See TracTickets for help on using tickets.