Opened 15 years ago
Closed 15 years ago
#2847 closed defect (fixed)
gdalwarp ignores cutline when -tr specified
Reported by: | warmerdam | Owned by: | warmerdam |
---|---|---|---|
Priority: | high | Milestone: | 1.6.1 |
Component: | Utilities | Version: | 1.6.0 |
Severity: | normal | Keywords: | gdalwarp cutline |
Cc: | vjetly |
Description
Frank,
I’m using gdal-16 and came across an issue while using gdalwarp with the cutline option. Basically it works as expected without the target resolution specified. So a simple call uses the cutline to restrict the source data area works fine:
E:\>gdalwarp E:\DEV\2009\Frank\Cutline\source.tif E:\DEV\2009\Frank\Cutline\out1.tif -cutline E:\DEV\2009\Frank\Cutline\alpha.shp Creating output file that is 655P x 520L. Processing input file E:\DEV\2009\Frank\Cutline\source.tif. 0...10...20...30...40...50...60...70...80...90...100 - done.
However, in the following command where the target resolution is lower than the source, the result is very different (its seems to ignore the cutline):
E:\>gdalwarp E:\DEV\2009\Frank\Cutline\source.tif E:\DEV\2009\Frank\Cutline\out2.tif -cutline E:\DEV\2009\Frank\Cutline\alpha.shp -tr 0.00015 0.00015 Creating output file that is 437P x 347L. Processing input file E:\DEV\2009\Frank\Cutline\source.tif. 0...10...20...30...40...50...60...70...80...90...100 - done.
Change History (5)
comment:1 by , 15 years ago
Status: | new → assigned |
---|
comment:2 by , 15 years ago
Priority: | normal → high |
---|
comment:3 by , 15 years ago
comment:5 by , 15 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
Note:
See TracTickets
for help on using tickets.
I have established that the problem is that the cutline is internally used to build source masks, but the LoadCutline() function in gdalwarp.cpp is actually transforming the cutline to *destination* file pixel coordinates.
Some non-trivial rework in gdalwarp.cpp will be required.