[gdal-dev] gdalwarp eats scale and offset

Kyle Shannon ksshannon at gmail.com
Wed Mar 21 18:01:11 EDT 2012


If I have a dataset with a scale and offset:

kyle at ubuntu:~/Desktop$ gdalinfo test.tif
 Driver: GTiff/GeoTIFF
Files: test.tif
Size is 738, 919
Coordinate System is:
PROJCS["WGS 84 / UTM zone 12N",
...
Origin = (279635.000000000000000,4878315.000000000000000)
Pixel Size = (30.000000000000000,-30.000000000000000)
Metadata:
AREA_OR_POINT=Point
Image Structure Metadata:
INTERLEAVE=BAND
Corner Coordinates:
Upper Left ( 279635.000, 4878315.000) (113d44'58.90"W, 44d 1'29.65"N)
Lower Left ( 279635.000, 4850745.000) (113d44'17.87"W, 43d46'37.04"N)
Upper Right ( 301775.000, 4878315.000) (113d28'25.33"W, 44d 1'52.37"N)
Lower Right ( 301775.000, 4850745.000) (113d27'48.41"W, 43d46'59.57"N)
Center ( 290705.000, 4864530.000) (113d36'22.60"W, 43d54'14.96"N)
Band 1 Block=738x1 Type=Float32, ColorInterp=Gray
Offset: 1, Scale:0.1

and I warp the image:

kyle at ubuntu:~/Desktop$ gdalwarp -t_srs epsg:4326 test.tif warp.tif
Creating output file that is 901P x 800L.
Processing input file test.tif.
0...10...20...30...40...50...60...70...80...90...100 - done.

My scale and offset disappear:

kyle at ubuntu:~/Desktop$ gdalinfo warp.tif

Driver: GTiff/GeoTIFF
Files: warp.tif
Size is 901, 800
Coordinate System is:
GEOGCS["WGS 84",
...
Origin = (-113.749693430469137,44.031215259056744)
Pixel Size = (0.000317850797006,-0.000317850797006)
Metadata:
AREA_OR_POINT=Point
Image Structure Metadata:
INTERLEAVE=BAND
Corner Coordinates:
Upper Left (-113.7496934, 44.0312153) (113d44'58.90"W, 44d 1'52.37"N)
Lower Left (-113.7496934, 43.7769346) (113d44'58.90"W, 43d46'36.96"N)
Upper Right (-113.4633099, 44.0312153) (113d27'47.92"W, 44d 1'52.37"N)
Lower Right (-113.4633099, 43.7769346) (113d27'47.92"W, 43d46'36.96"N)
Center (-113.6065016, 43.9040749) (113d36'23.41"W, 43d54'14.67"N)
Band 1 Block=901x2 Type=Float32, ColorInterp=Gray

I couldn't find any docs on this. Is this known and/or expected? I would
think scale and offset would be transferred to the new file.

/**
 *
 * Kyle Shannon
 * ksshannon at gmail.com
 *
 */
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/gdal-dev/attachments/20120321/1c889bc5/attachment.html


More information about the gdal-dev mailing list