Bug report #20912

gdalwarp on 3.4.3 behaving differently to 3.4.2

Added by Ross Edwards almost 6 years ago. Updated almost 6 years ago.

Status:Closed
Priority:Normal
Assignee:Ross Edwards
Category:GDAL Tools
Affected QGIS version:3.4.3 Regression?:No
Operating System:Windows 10 Easy fix?:No
Pull Request or Patch supplied:No Resolution:up/downstream
Crashes QGIS or corrupts data:Yes Copied to github as #:28731

Description

I found an entirely repeatable issue with gdalwarp commands that worked perfectly on 3.4.2, but on 3.4.3 they appear to generate slightly off height and width.

on 3.4.2 I run the following 2 commands separately in Python console -

gdalwarp -t_srs EPSG:32631 -wo SOURCE_EXTRA=1000 -tr 5.0 5.0 -r cubic -of GTiff "E:/Users/rosso/Arma/Terrain Heightmaps/Heightmaps Opentopo/output_srtm.asc" D:/Arma/QGIS/crm4.tif

gdalwarp -of GTiff -cutline E:\Users\rosso\Arma\QGIS\UTM31N\Test23-11-18\shape.shp -crop_to_cutline "D:/Arma/QGIS/crm4.tif" D:/Arma/QGIS/cut6.tif

which generates a perfect 8192 x 8192 tif
https://ibb.co/6PmvQ8x

However running exactly the same on 3.4.3

gdalwarp -t_srs EPSG:32631 -wo SOURCE_EXTRA=1000 -tr 5.0 5.0 -r cubic -of GTiff "E:/Users/rosso/Arma/Terrain Heightmaps/Heightmaps Opentopo/output_srtm.asc" D:/Arma/QGIS/crm5.tif

gdalwarp -of GTiff -cutline E:\Users\rosso\Arma\QGIS\UTM31N\Test23-11-18\shape.shp -crop_to_cutline "D:/Arma/QGIS/crm5.tif" D:/Arma/QGIS/cut7.tif

I get a tif with 8191 x 8191
https://ibb.co/0GcptBT

History

#1 Updated by Ross Edwards almost 6 years ago

Just to confirm the shapefile feature used to cut the tif is a perfect square 40960 x 40960 so at 5m resolution I expect 8192 output

#2 Updated by Nyall Dawson almost 6 years ago

  • Resolution set to up/downstream
  • Status changed from Open to Closed

If the difference is encountered when using the exact same gdal command then the change must be in gdal itself -- you'll need to file this on gdal's tracker.

Also available in: Atom PDF