Opened 11 years ago
Closed 11 years ago
#5069 closed defect (fixed)
gdalwarp fails warping tiffs with different resolution units
Reported by: | cdestigter | Owned by: | Robert Coup |
---|---|---|---|
Priority: | normal | Milestone: | |
Component: | GDAL_Raster | Version: | 1.10.0 |
Severity: | normal | Keywords: | |
Cc: |
Description (last modified by )
We've got two tiffs here, one with pixels/inch and the other with pixels/cm resolution units. Goodness knows why, but I'd assume gdal could multiply out the resolutions properly when merging them.
rm -f out.tif ; gdalwarp -of GTiff -co TILED=YES -co COMPRESS=DEFLATE -te 19296899.6093 -4620876.43484 19453442.6432 -4464333.40091 -ts 500 500 inch.tif cm.tif out.tif
Creating output file that is 500P x 500L. Processing input file inch.tif. 0...10...20...30...40...50...60...70...80...90...100 - done. Processing input file cm.tif. 0...10...20...30...40...50...60...70...80...90...100 - done. ERROR 1: _TIFFVSetField:out.tif: Bad value 0 for "ResolutionUnit" tag
Our gdal was built from our github fork, ie https://github.com/koordinates/gdal/tree/252ed79 which is basically 1.10 branch from about 10 days ago.
Attachments (2)
Change History (8)
by , 11 years ago
by , 11 years ago
comment:1 by , 11 years ago
Description: | modified (diff) |
---|
comment:2 by , 11 years ago
comment:3 by , 11 years ago
ah, FYI those two tiffs are licensed CC-BY, from LINZ. They're two tiles from http://data-test.linz.govt.nz/#/layer/169-nz-mainland-terrain-relief-topo-50/
(super downscaled, obviously)
comment:4 by , 11 years ago
ah, FYI those two tiffs are licensed CC-BY, from LINZ. They're two tiles from http://data.linz.govt.nz/#/layer/765-nz-terrain-relief-topo50/
(super downscaled, obviously)
If an admin could delete my last comment I'd appreciate it, posted internal link by accident.
comment:5 by , 11 years ago
Owner: | changed from | to
---|---|
Status: | new → assigned |
comment:6 by , 11 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
I think https://github.com/OSGeo/gdal/blob/trunk/gdal/frmts/gtiff/geotiff.cpp#L5047 is the culprit:
atoi('*')
will return 0, but it looks like TIFFTAG_RESOLUTIONUNIT=1 is 'unknown', 0 isn't a valid value.