[GRASS-user] Landsat image tiffs

Zenon Panoussis oracle at provocation.net
Sat Aug 19 16:01:58 EDT 2006


Dylan Beaudette wrote:

>>> #export tiled landsat-shade tiles:
>>> for x in `seq 2 1 49`; do g.region rast=ca_landsat_shade_$x; r.out.tiff
>>> -t in=ca_landsat_shade_$x out=ca_landsat_shade_$x.tif; done

>>> # re-create geotiffs with gdal_translate (fix bug in tiffs created with
>>> r.out.tiff)
>>> for x in `ls *.tif`; do gdal_translate -a_srs '+proj=aea +x_0=0.0
>>> +y_0=0.0 +lon_0=-96.0 +lat_0=40.0 +lat_1=20.0 +lat_2=60.0 +datum=NAD83'
>>> $x ../new/$x ; done

I tried it, alas to no avail. However, as I went along trying to find
candidate error sources, I noticed some oddities with my rasters. For
example, the output of gdalinfo on the final tiffs said

>> Size is 15535, 14461

That's one pixel too many in both x and y. And the resolution of my
location (same as the landsat tile) was 14.50 instead of 14.25. I have
absolutely no clue how this could happen, because I created the location
with 'r.in.gdal ... location=blah' on the first imported band, but there
it was. The corner coordinates were skewed too compared to the original
downloaded tiffs, just so little as to avoid detection by a casual look,
but enough to cause trouble. E.g.

>> Upper Left  (  243347.250,-1176408.750)
>> Lower Right (  464721.000,-1382478.000)

said the final tiff and

Upper Left  (  243354.375,-1176415.875) ( 77d20'44.97"W, 10d38'0.28"S)
Lower Right (  464713.875,-1382470.875) ( 75d19'29.14"W, 12d30'19.71"S)

said the NASA original. There could be a bug somewhere, but I figured
that if I don't waste my time hunting it, it will sooner or later come
back to hunt me and so I'll find it anyway.

So I started from scratch again, this time skipping over r.landsat.rgb
and verifying my results after every step. I got a final tiff that appeared
perfect, but still had the same problem. Fooling around with projections
in the the mapfile got me half a step further though,
http://www.nabble.com/Re%3A-Landsat-image-tiffs-p5882076.html
so now I want to make really sure I have no errors on the mapserver side
before I carry on the fight with gdal and grass.

Z





More information about the grass-user mailing list