2

I have a LZW-compressed GeoTIFF file and would like to split it into several smaller regional files and change the format to png. I tried to do the spliting with gdal_translate -srcwin. I only get a black image. I guess that I first have to deal with the LZW-compression, but I cannot find a way to decompress files.

To compress the file I have the option -co COMPRESS=LZW. But how do I go the other way around. I am very much looking forward to your answers! :)

Here is the command I used:

$ gdal_translate -ot UInt16 -srcwin 6500 3300 1000 1000 input.tif output.tif

$ gdal_translate -of PNG -scale output.tif output.png

This is what gdalinfo says:

$ gdalinfo input.tif
Driver: GTiff/GeoTIFF
Files: EUD_CP-DEMS_2500035000-AA.tif
Size is 40000, 40000
Coordinate System is:
PROJCS["ETRS89 / ETRS-LAEA",
    GEOGCS["ETRS89",
        DATUM["European_Terrestrial_Reference_System_1989",
            SPHEROID["GRS 1980",6378137,298.2572221000027,
                AUTHORITY["EPSG","7019"]],
            AUTHORITY["EPSG","6258"]],
        PRIMEM["Greenwich",0],
        UNIT["degree",0.0174532925199433],
        AUTHORITY["EPSG","4258"]],
    PROJECTION["Lambert_Azimuthal_Equal_Area"],
    PARAMETER["latitude_of_center",52],
    PARAMETER["longitude_of_center",10], 
    PARAMETER["false_easting",4321000],
    PARAMETER["false_northing",3210000],
    UNIT["metre",1,
        AUTHORITY["EPSG","9001"]],
    AUTHORITY["EPSG","3035"]]
Origin = (2000000.000000000000000,4000000.000000000000000)
Pixel Size = (25.000000000000000,-25.000000000000000)
Metadata:
  TIFFTAG_DOCUMENTNAME=EUD_CP-DEMS_2500035000-AA.tif
  TIFFTAG_IMAGEDESCRIPTION=File written by egcs_wrgtif 2.1
  TIFFTAG_SOFTWARE=IDL 8.2, Exelis Visual Information Solutions, Inc.
  TIFFTAG_DATETIME=2013:09:17 18:46:37
  TIFFTAG_XRESOLUTION=100
  TIFFTAG_YRESOLUTION=100
  TIFFTAG_RESOLUTIONUNIT=2 (pixels/inch)
  AREA_OR_POINT=Area
Image Structure Metadata:
  COMPRESSION=LZW
  INTERLEAVE=BAND
Corner Coordinates:
Upper Left  ( 2000000.000, 4000000.000) ( 26d54'5.12"W, 53d35'57.62"N)
Lower Left  ( 2000000.000, 3000000.000) ( 20d45'24.21"W, 45d41'42.74"N)
Upper Right ( 3000000.000, 4000000.000) ( 12d15'58.58"W, 57d13'49.19"N)
Lower Right ( 3000000.000, 3000000.000) (  8d 7'39.52"W, 48d38'23.47"N)
Center      ( 2500000.000, 3500000.000) ( 16d56'50.88"W, 51d31'45.31"N)
Band 1 Block=40000x1 Type=Float32, ColorInterp=Gray
  • Welcome to gis.SE. Do you mean LZW? If not, can you explain your needs more? Also, can you show the exact command(s) you used. – BradHards Apr 10 '14 at 9:51
  • Yes, I mean LZW. Sorry for that! – Nizzi Apr 10 '14 at 9:56
  • Please update the question (including the other information I asked for). You can click edit below the question to do this. – BradHards Apr 10 '14 at 10:00
  • 1
    have you tried gdal_translate -co COMPRESS=NONE ? Note that I am not sure that the compression is the issue. – radouxju Apr 10 '14 at 10:22
  • Thanks radouxju, I tried it. The line COMPRESSION=LZW in the gdalinfo is gone afterwards. Instead of a completely black tiff-file I get a chequerboard pattern. Nevertheless it is still not working properly. – Nizzi Apr 10 '14 at 13:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.