[Gdal-dev] (little) Problem with the gdal_translate srcwin option

Olivier Wymann olivier.wymann at itelios.com
Thu Jan 26 05:33:39 EST 2006


Hi,

 

I'm using gdal v1.3.1.0, and I got a problem when I try to extract a
subwin from a geotiff file :

 

gdal_translate -srcwin 400 400 230 360 test.tif dest.tif

 

The output file size and new geocoordinates seem to be ok, but the
problem is the new file itself : in TatukGIS, the dest.tif file looks as
if the 3 bans where displayed with 3 different vertical offsets (not
very easy to explain...imagine the red band starting at y=0, the green
at y= n and the blue starting at y=approximately n+n), but curiously,
where I open the file in Photoshop, or if I translate it in JPEG, it
looks great. Any Idea ?

 

FILE INFORMATIONS :

 

Original

 

Driver: GTiff/GeoTIFF

Size is 2299, 1686

Coordinate System is:

GEOGCS["WGS 84",

    DATUM["WGS_1984",

        SPHEROID["WGS 84",6378137,298.2572235630016,

            AUTHORITY["EPSG","7030"]],

        AUTHORITY["EPSG","6326"]],

    PRIMEM["Greenwich",0],

    UNIT["degree",0.0174532925199433],

    AUTHORITY["EPSG","4326"]]

Origin = (1.356243,43.109269)

Pixel Size = (0.00005390,-0.00005390)

Metadata:

  AREA_OR_POINT=Area

Corner Coordinates:

Upper Left  (   1.3562432,  43.1092686) (  1d21'22.48"E, 43d

Lower Left  (   1.3562432,  43.0183852) (  1d21'22.48"E, 43d

Upper Right (   1.4801703,  43.1092686) (  1d28'48.61"E, 43d

Lower Right (   1.4801703,  43.0183852) (  1d28'48.61"E, 43d

Center      (   1.4182067,  43.0638269) (  1d25'5.54"E, 43d

Band 1 Block=2299x1 Type=Byte, ColorInterp=Red

Band 2 Block=2299x1 Type=Byte, ColorInterp=Green

Band 3 Block=2299x1 Type=Byte, ColorInterp=Blue

 

COMMAND

 

>gdal_translate -srcwin 400 400 230 360 test.tif dest.tif

(performs without warnings)

 

SUBWIN FILE

 

>gdalinfo dest.tif

 

Driver: GTiff/GeoTIFF

Size is 230, 360

Coordinate System is:

GEOGCS["WGS 84",

    DATUM["WGS_1984",

        SPHEROID["WGS 84",6378137,298.2572235630016,

            AUTHORITY["EPSG","7030"]],

        AUTHORITY["EPSG","6326"]],

    PRIMEM["Greenwich",0],

    UNIT["degree",0.0174532925199433],

    AUTHORITY["EPSG","4326"]]

Origin = (1.377805,43.087707)

Pixel Size = (0.00005390,-0.00005390)

Metadata:

  AREA_OR_POINT=Area

Corner Coordinates:

Upper Left  (   1.3778051,  43.0877067) (  1d22'40.10"E, 43d 5'15.74"N)

Lower Left  (   1.3778051,  43.0683010) (  1d22'40.10"E, 43d 4'5.88"N)

Upper Right (   1.3902032,  43.0877067) (  1d23'24.73"E, 43d 5'15.74"N)

Lower Right (   1.3902032,  43.0683010) (  1d23'24.73"E, 43d 4'5.88"N)

Center      (   1.3840042,  43.0780038) (  1d23'2.41"E, 43d 4'40.81"N)

Band 1 Block=230x35 Type=Byte, ColorInterp=Red

Band 2 Block=230x35 Type=Byte, ColorInterp=Green

Band 3 Block=230x35 Type=Byte, ColorInterp=Blue

 

Thank you for your help

 

 

Olivier

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/gdal-dev/attachments/20060126/be467f75/attachment.html


More information about the Gdal-dev mailing list