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)
Change History (4)
by , 10 years ago
Attachment: | mytif_lowres_1.TIF added |
---|
comment:1 by , 10 years ago
Bug present in linux machines (tested red hat and ubuntu) Bug not present in windows
comment:2 by , 10 years ago
Resolution: | → duplicate |
---|---|
Status: | new → closed |
I can't replicate the issue with trunk. I believe this has been fixed by #5311.
Output raster file after "gdalwarp -tr 1.0 1.0 mytif.TIF mytif_lowres_1.TIF"