<p dir="ltr">Nicole,</p>
<p dir="ltr">The problem is reading the source file itself. GDAL is unable to find any valid pixels. Check if you are using the latest GDAL binaries. Use "gdalinfo -version". Use qgis to view the input and output. GIMP can't handle anything except basic pixel types. The -mm option should find some valid pixels if everything is good.</p>

<p dir="ltr">Later, you should scale the pixel values to 0-255 range to represent them in PNG.</p>
<p dir="ltr">--<br>
Best regards,<br>
Chaitanya Kumar CH</p>
<div class="gmail_quote">On 15-Apr-2014 4:40 pm, "Nicole Stoffels" <<a href="mailto:stoffels@f2e.de">stoffels@f2e.de</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Thank you both for your answers. I have applied your suggestions.<br>
<br>
Making a single command works but does not change the result.<br>
<br>
Concerning the compression, I used LZW instead of NONE. However, it also does not make any difference.<br>
<br>
I also changed the srcwin parameters. I do not get any errors and the gdalinfo says that the subarea is within the original area.<br>
<br>
I skipped the png part to make it easier first. And after trying to open the new tif with gimp and getting an error message that the float32 data cannot be displayed I added the ot-flag. Here is my new command line:<br>
<br>
$ gdal_translate -ot Byte -srcwin 0 0 4000 4000 -co COMPRESS=LZW EUD_CP-DEMS_6500035000-AA.tif test.tif<br>
<br>
What I get is a completely black tif. Here are the two gdalinfo-outputs, that I get:<br>
<br>
$ gdalinfo -mm EUD_CP-DEMS_6500035000-AA.tif<br>
Driver: GTiff/GeoTIFF<br>
Files: EUD_CP-DEMS_6500035000-AA.tif<br>
Size is 40000, 40000<br>
Coordinate System is:<br>
PROJCS["ETRS89 / ETRS-LAEA",<br>
    GEOGCS["ETRS89",<br>
        DATUM["European_Terrestrial_<u></u>Reference_System_1989",<br>
            SPHEROID["GRS 1980",6378137,298.<u></u>2572221000027,<br>
                AUTHORITY["EPSG","7019"]],<br>
            AUTHORITY["EPSG","6258"]],<br>
        PRIMEM["Greenwich",0],<br>
        UNIT["degree",0.<u></u>0174532925199433],<br>
        AUTHORITY["EPSG","4258"]],<br>
    PROJECTION["Lambert_Azimuthal_<u></u>Equal_Area"],<br>
    PARAMETER["latitude_of_center"<u></u>,52],<br>
    PARAMETER["longitude_of_<u></u>center",10],<br>
    PARAMETER["false_easting",<u></u>4321000],<br>
    PARAMETER["false_northing",<u></u>3210000],<br>
    UNIT["metre",1,<br>
        AUTHORITY["EPSG","9001"]],<br>
    AUTHORITY["EPSG","3035"]]<br>
Origin = (6000000.000000000000000,<u></u>4000000.000000000000000)<br>
Pixel Size = (25.000000000000000,-25.<u></u>000000000000000)<br>
Metadata:<br>
  TIFFTAG_DOCUMENTNAME=EUD_CP-<u></u>DEMS_6500035000-AA.tif<br>
  TIFFTAG_IMAGEDESCRIPTION=File written by egcs_wrgtif 2.1<br>
  TIFFTAG_SOFTWARE=IDL 8.2, Exelis Visual Information Solutions, Inc.<br>
  TIFFTAG_DATETIME=2013:09:17 21:00:27<br>
  TIFFTAG_XRESOLUTION=100<br>
  TIFFTAG_YRESOLUTION=100<br>
  TIFFTAG_RESOLUTIONUNIT=2 (pixels/inch)<br>
  AREA_OR_POINT=Area<br>
Image Structure Metadata:<br>
  COMPRESSION=LZW<br>
  INTERLEAVE=BAND<br>
Corner Coordinates:<br>
Upper Left  ( 6000000.000, 4000000.000) ( 37d47'0.49"E, 56d 7'28.33"N)<br>
Lower Left  ( 6000000.000, 3000000.000) ( 32d47'35.21"E, 47d45'16.08"N)<br>
Upper Right ( 7000000.000, 4000000.000) ( 51d32'27.75"E, 51d55'27.24"N)<br>
Lower Right ( 7000000.000, 3000000.000) ( 44d57'3.39"E, 44d18'11.63"N)<br>
Center      ( 6500000.000, 3500000.000) ( 41d41'39.51"E, 50d15'46.40"N)<br>
Band 1 Block=40000x1 Type=Float32, ColorInterp=Gray<br>
ERROR 1: Failed to compute min/max, no valid pixels found in sampling.<br>
<br>
$ gdalinfo -mm test.tif<br>
Driver: GTiff/GeoTIFF<br>
Files: test.tif<br>
Size is 4000, 4000<br>
Coordinate System is:<br>
PROJCS["ETRS89 / ETRS-LAEA",<br>
    GEOGCS["ETRS89",<br>
        DATUM["European_Terrestrial_<u></u>Reference_System_1989",<br>
            SPHEROID["GRS 1980",6378137,298.<u></u>2572221010002,<br>
                AUTHORITY["EPSG","7019"]],<br>
            AUTHORITY["EPSG","6258"]],<br>
        PRIMEM["Greenwich",0],<br>
        UNIT["degree",0.<u></u>0174532925199433],<br>
        AUTHORITY["EPSG","4258"]],<br>
    PROJECTION["Lambert_Azimuthal_<u></u>Equal_Area"],<br>
    PARAMETER["latitude_of_center"<u></u>,52],<br>
    PARAMETER["longitude_of_<u></u>center",10],<br>
    PARAMETER["false_easting",<u></u>4321000],<br>
    PARAMETER["false_northing",<u></u>3210000],<br>
    UNIT["metre",1,<br>
        AUTHORITY["EPSG","9001"]],<br>
    AUTHORITY["EPSG","3035"]]<br>
Origin = (6000000.000000000000000,<u></u>4000000.000000000000000)<br>
Pixel Size = (25.000000000000000,-25.<u></u>000000000000000)<br>
Metadata:<br>
  TIFFTAG_DOCUMENTNAME=EUD_CP-<u></u>DEMS_6500035000-AA.tif<br>
  TIFFTAG_IMAGEDESCRIPTION=File written by egcs_wrgtif 2.1<br>
  TIFFTAG_SOFTWARE=IDL 8.2, Exelis Visual Information Solutions, Inc.<br>
  TIFFTAG_DATETIME=2013:09:17 21:00:27<br>
  TIFFTAG_XRESOLUTION=100<br>
  TIFFTAG_YRESOLUTION=100<br>
  TIFFTAG_RESOLUTIONUNIT=2 (pixels/inch)<br>
  AREA_OR_POINT=Area<br>
Image Structure Metadata:<br>
  COMPRESSION=LZW<br>
  INTERLEAVE=BAND<br>
Corner Coordinates:<br>
Upper Left  ( 6000000.000, 4000000.000) ( 37d47'0.49"E, 56d 7'28.33"N)<br>
Lower Left  ( 6000000.000, 3900000.000) ( 37d10'18.23"E, 55d18'7.26"N)<br>
Upper Right ( 6100000.000, 4000000.000) ( 39d16'14.71"E, 55d46'30.54"N)<br>
Lower Right ( 6100000.000, 3900000.000) ( 38d38'6.52"E, 54d57'38.92"N)<br>
Center      ( 6050000.000, 3950000.000) ( 38d12'51.64"E, 55d32'35.70"N)<br>
Band 1 Block=4000x2 Type=Byte, ColorInterp=Gray<br>
    Computed Min/Max=0.000,0.000<br>
<br>
Am <a href="tel:14.04.2014%2019" value="+911404201419" target="_blank">14.04.2014 19</a>:51, schrieb Etienne Tourigny:><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
<br>
On Mon, Apr 14, 2014 at 11:16 AM, Nicole Stoffels <<a href="mailto:stoffels@f2e.de" target="_blank">stoffels@f2e.de</a><br>
<mailto:<a href="mailto:stoffels@f2e.de" target="_blank">stoffels@f2e.de</a>>> wrote:<br>
<br>
    Dear Gdal-List,<br>
<br>
    I have a large ASTER file (downloaded from<br>
    <a href="http://www.eea.europa.eu/data-__and-maps/data/eu-dem#tab-__european-data" target="_blank">http://www.eea.europa.eu/data-<u></u>__and-maps/data/eu-dem#tab-__<u></u>european-data</a><br>
    <<a href="http://www.eea.europa.eu/data-and-maps/data/eu-dem#tab-european-data" target="_blank">http://www.eea.europa.eu/<u></u>data-and-maps/data/eu-dem#tab-<u></u>european-data</a>>)<br>
    in the GeoTIFF-format. It is compressed with LZW. What I want to do is:<br>
<br>
    1. unpack it<br>
    2. seperate a smaller region from it<br>
    3. convert this regional GeoTIFF to a PNG<br>
<br>
    What I am doing:<br>
<br>
    $ gdal_translate -co COMPRESS=NONE EUD_CP-DEMS_6500035000-AA.tif<br>
    tmp1.tif<br>
<br>
    $ gdal_translate -srcwin 6500 3300 1000 1000 tmp1.tif tmp2.tif<br>
<br>
    $ gdal_translate -of PNG tmp2.tif tmp2.png<br>
<br>
    When I display the info with gdalinfo the first step seems to<br>
    produce a decompressed file. The line COMPRESSION=LZW is not there<br>
    anymore.<br>
<br>
<br>
You need to set the compression options on any gdal command, it does not<br>
use the compression of the input file. Also, you specifically asked for<br>
no compression, so it's doing what you told it to.<br>
use "-co COMPRESS=LZW"<br>
</blockquote>
<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
    However, if I want to display the min and max with gdalinfo, I get<br>
    the following error.<br>
<br>
    ERROR 1: Failed to compute min/max, no valid pixels found in sampling.<br>
<br>
<br>
try without changing the extents and see if a single command (as<br>
suggested by Jean-Luc) works<br>
<br>
<br>
    I thought that the file might be too large, but if I change the<br>
    data_type from float 32 to e.g. Int16 I get 0 as min and max value.<br>
    That's why I assume that already the first gdal_translate does not<br>
    work as I actually want it to work.<br>
<br>
<br>
your input values are probably between 0 and 1 in this case<br>
<br>
<br>
    The other two transformations work without error messages. However,<br>
    in the end I get a black png.<br>
<br>
    I have tried all types of transformation with various options. But<br>
    as I am new in the subject and do not know much about gdal, I have<br>
    no further ideas how to generate a file from my large GeoTIFF to<br>
    continue working with.<br>
<br>
    I hope someone has an idea, what's going wrong with my<br>
    gdal_translations. Thanks very much in advance.<br>
<br>
    Best regards<br>
    Nicole<br>
    ______________________________<u></u>___________________<br>
    gdal-dev mailing list<br>
    <a href="mailto:gdal-dev@lists.osgeo.org" target="_blank">gdal-dev@lists.osgeo.org</a> <mailto:<a href="mailto:gdal-dev@lists.osgeo.org" target="_blank">gdal-dev@lists.osgeo.<u></u>org</a>><br>
    <a href="http://lists.osgeo.org/__mailman/listinfo/gdal-dev" target="_blank">http://lists.osgeo.org/__<u></u>mailman/listinfo/gdal-dev</a><br>
    <<a href="http://lists.osgeo.org/mailman/listinfo/gdal-dev" target="_blank">http://lists.osgeo.org/<u></u>mailman/listinfo/gdal-dev</a>><br>
<br>
<br>
</blockquote>
<br>
<br>
<br>
______________________________<u></u>_________________<br>
gdal-dev mailing list<br>
<a href="mailto:gdal-dev@lists.osgeo.org" target="_blank">gdal-dev@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/gdal-dev" target="_blank">http://lists.osgeo.org/<u></u>mailman/listinfo/gdal-dev</a><br>
</blockquote></div>