Hi,
You can do all these operation in one command :
gdal_translate -of PNG -srcwin xoff yoff xsize ysize "input.tif"
"output.png"
Are you sure of your scrwin parameters ?
Le 2014-04-14 16:16, Nicole Stoffels a écrit :
Dear Gdal-List,
I have a large ASTER file (downloaded from
http://www.eea.europa.eu/data-and-maps/data/eu-dem#tab-european-data)
in the GeoTIFF-format. It is compressed with LZW. What I want to do
is:
1. unpack it
2. seperate a smaller region from it
3. convert this regional GeoTIFF to a PNG
What I am doing:
$ gdal_translate -co COMPRESS=NONE EUD_CP-DEMS_6500035000-AA.tif
tmp1.tif
$ gdal_translate -srcwin 6500 3300 1000 1000 tmp1.tif tmp2.tif
$ gdal_translate -of PNG tmp2.tif tmp2.png
When I display the info with gdalinfo the first step seems to produce
a decompressed file. The line COMPRESSION=LZW is not there anymore.
However, if I want to display the min and max with gdalinfo, I get the
following error.
ERROR 1: Failed to compute min/max, no valid pixels found in sampling.
I thought that the file might be too large, but if I change the
data_type from float 32 to e.g. Int16 I get 0 as min and max value.
That's why I assume that already the first gdal_translate does not
work as I actually want it to work.
The other two transformations work without error messages. However, in
the end I get a black png.
I have tried all types of transformation with various options. But as
I am new in the subject and do not know much about gdal, I have no
further ideas how to generate a file from my large GeoTIFF to continue
working with.
I hope someone has an idea, what's going wrong with my
gdal_translations. Thanks very much in advance.
Best regards
Nicole
_______________________________________________
gdal-dev mailing list
gdal-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/gdal-dev