[gdal-dev] GeoTiff - image coordinates and world file

Even Rouault even.rouault at mines-paris.org
Thu Oct 22 14:02:43 EDT 2009


Selon Aleksey Naumov <anaumov at gmail.com>:

GDAL GeoTIFF driver always use the GeoTIFF tag when it is found. Worldfiles are
only used when no GeoTIFF tag exists.

One way of achieving what you want to do is to produce a clone of your original
GeoTIFF without the geotiff tag by using the PROFILE=BASELINE creation option.

For example :
gdal_translate 1km177310505102008GROUPEALTA.tif
1km177310505102008GROUPEALTA_nogeotifftag.tif -co PROFILE=BASELINE

and then rename your worldfile to 1km177310505102008GROUPEALTA_nogeotifftag.wld

> HI all,
>
> I am trying to understand how coordinate information is stored in a GeoTiff
> file, specifically the origin (UL corner) of the image. I have a few images
> which clearly have wrong origins, so they do not display correctly. Both
> ArcGIS and GDAL report incorrect origins.
>
> Initially I thought that the world files for the images were at fault,
> however, they look totally fine. Here is an example -- notice really large
> X-coord of origin as reported by gdalinfo:
> > gdalinfo 1km177310505102008GROUPEALTA.tif
> Driver: GTiff/GeoTIFF
> Files: 1km177310505102008GROUPEALTA.tif
>        1km177310505102008GROUPEALTA.tfw
> Size is 5000, 5000
> Coordinate System is:
> PROJCS["UTM Zone 17N",
>     GEOGCS["NAD83_CSRS_1",
>         DATUM["NAD83_CSRS_1",
>             SPHEROID["GRS 1980",6378137,298.2572220960423]],
>         PRIMEM["Greenwich",0],
>         UNIT["degree",0.0174532925199433]],
>     PROJECTION["Transverse_Mercator"],
>     PARAMETER["latitude_of_origin",0],
>     PARAMETER["central_meridian",-81],
>     PARAMETER["scale_factor",0.9996],
>     PARAMETER["false_easting",500000],
>     PARAMETER["false_northing",0],
>     UNIT["metre",1,
>         AUTHORITY["EPSG","9001"]]]
> Origin = (5051999.800000000700000,5052000.000000000000000)
> Pixel Size = (0.200000000000000,-0.200000000000000)
> Metadata:
>   TIFFTAG_SOFTWARE=Adobe Photoshop CS2 Windows
>   TIFFTAG_DATETIME=2008:12:30 16:08:24
>   TIFFTAG_XRESOLUTION=72
>   TIFFTAG_YRESOLUTION=72
>   TIFFTAG_RESOLUTIONUNIT=2 (pixels/inch)
>   AREA_OR_POINT=Area
> Image Structure Metadata:
>   INTERLEAVE=PIXEL
> Corner Coordinates:
> Upper Left  ( 5051999.800, 5052000.000) ( 34d52'42.64"W, 34d45'16.48"N)
> Lower Left  ( 5051999.800, 5051000.000) ( 34d52'48.38"W, 34d44'52.51"N)
> Upper Right ( 5052999.800, 5052000.000) ( 34d52'28.05"W, 34d45'5.78"N)
> Lower Right ( 5052999.800, 5051000.000) ( 34d52'33.77"W, 34d44'41.81"N)
> Center      ( 5052499.800, 5051500.000) ( 34d52'38.21"W, 34d44'59.14"N)
> Band 1 Block=5000x1 Type=Byte, ColorInterp=Red
> Band 2 Block=5000x1 Type=Byte, ColorInterp=Green
> Band 3 Block=5000x1 Type=Byte, ColorInterp=Blue
>
> The world file looks fine to me, and it has correct origin info (X-coord):
> > type 1km177310505102008GROUPEALTA.tfw
> 0.200000
> 0.000000
> 0.000000
> -0.200000
> 731000.100000
> 5051999.900000
>
> Even if I rename the TFW file, gdalinfo still reports the same incorrect
> origin, so it must be stored in a GeoTiff tag, I guess? If so, how do I
> override and correct this info on an image? Also, does a world file not have
> a higher priority than a built-in tag value?
>
> Thank you,
> Aleksey
>




More information about the gdal-dev mailing list