Opened 10 years ago

Closed 10 years ago

#5406 closed defect (duplicate)

gdalwarp 1.10.1 : downsampling with 'average' option, pixel definition makes faulty aggregation

Reported by: bmr9 Owned by: warmerdam
Priority: normal Milestone:
Component: Algorithms Version: 1.10.1
Severity: major Keywords: gdalwarp, average, downsampling, aggregation
Cc:

Description

Just checked gdalwarp downsampling with '-r average' option, for SAME input and output resolution.

Input: $ gdalwarp -tr 1 1 -r average mytif.TIF mytif_lowres_1.TIF

Actual result: mytif.TIF and mytif_lowres_1.TIF present different values and a shift in values to the upper left corner of the image.

Expected result: mytif.TIF and mytif_lowres_1.TIF should present same values.

More examples: similar behaviour when changing resolution (-tr 2 2, for instance)

Additional information:

mytif.TIF array-like values are:

[[ 0. 0. 0. 0. 0. 0. 0. 0. 0. 0.]

[ 0. 0. 0. 0. 0. 0. 0. 0. 0. 0.]

[ 0. 0. 1. 1. 1. 1. 1. 1. 0. 0.]

[ 0. 0. 1. 1. 1. 1. 1. 1. 0. 0.]

[ 0. 0. 1. 1. 1. 1. 1. 1. 0. 0.]

[ 0. 0. 1. 1. 1. 1. 1. 1. 0. 0.]

[ 0. 0. 1. 1. 1. 1. 1. 1. 0. 0.]

[ 0. 0. 1. 1. 1. 1. 1. 1. 0. 0.]

[ 0. 0. 0. 0. 0. 0. 0. 0. 0. 0.]

[ 0. 0. 0. 0. 0. 0. 0. 0. 0. 0.]]

mytif_lowres_1.TIF array-like values are:

[[ 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. ]

[ 0. 0.25 0.5 0.5 0.5 0.5 0.5 0.25 0. 0. ]

[ 0. 0.5 1. 1. 1. 1. 1. 0.5 0. 0. ]

[ 0. 0.5 1. 1. 1. 1. 1. 0.5 0. 0. ]

[ 0. 0.5 1. 1. 1. 1. 1. 0.5 0. 0. ]

[ 0. 0.5 1. 1. 1. 1. 1. 0.5 0. 0. ]

[ 0. 0.5 1. 1. 1. 1. 1. 0.5 0. 0. ]

[ 0. 0.25 0.5 0.5 0.5 0.5 0.5 0.25 0. 0. ]

[ 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. ]

[ 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. ]]

Attachments (2)

mytif_lowres_1.TIF (766 bytes ) - added by bmr9 10 years ago.
Output raster file after "gdalwarp -tr 1.0 1.0 mytif.TIF mytif_lowres_1.TIF"
mytif.TIF (766 bytes ) - added by bmr9 10 years ago.
Original raster file (TIF): resolution 1.0 1.0

Download all attachments as: .zip

Change History (4)

by bmr9, 10 years ago

Attachment: mytif_lowres_1.TIF added

Output raster file after "gdalwarp -tr 1.0 1.0 mytif.TIF mytif_lowres_1.TIF"

by bmr9, 10 years ago

Attachment: mytif.TIF added

Original raster file (TIF): resolution 1.0 1.0

comment:1 by bmr9, 10 years ago

Bug present in linux machines (tested red hat and ubuntu) Bug not present in windows

comment:2 by Even Rouault, 10 years ago

Resolution: duplicate
Status: newclosed

I can't replicate the issue with trunk. I believe this has been fixed by #5311.

Note: See TracTickets for help on using tickets.