[Gdal-dev] XResolution tag in GeoTiff

Frank Warmerdam fwarmerdam at gmail.com
Wed Jul 6 10:59:31 EDT 2005


On 7/5/05, Gérald CLETTE <gerald.clette at free.fr> wrote:
> Hi
> 
> I developped a new driver based on the GDAL data model to handle a new
> format with the gdal_warp tool.
> Then, I tried to create a GTIFF product but the new file didn't contain the
> XResolution, YResolution nor ResolutionUnit tags. I thought that these tags
> were not optionnal in the GeoTiff description.

Gérald,

The XResolution, YResolution and ResolutionUnit flags are not related to
the GeoTIFF specification.  I am not aware of these being required tags
in the core TIFF specification though it is possible.  If so, could you provide
a reference? 

> My question is : Is it a bug in the Geotiff library ? Or how can I manage to
> product a "full" GeoTiff product with gdal_warp ?

The -mo flag to gdal_translate can be used to add dataset level 
metadata which is how the GDAL GeoTIFF  driver handles the 
resolution information.  Something like the following would set a
72dpi (dots per inch) screen resolution:

gdal_translate in.tif out.tif \
      -mo TIFFTAG_XRESOLUTION=72 \
      -mo TIFFTAG_XRESOLUTION=72 \
      -mo TIFFTAG_RESOLUTIONUNIT=2

See the TIFF tag list for details on resolution unit values:
   http://www.awaresystems.be/imaging/tiff/tifftags/resolutionunit.html

PS. Keep in mind that the x/yresolution values have nothing
to do with geospatial resolution.  It is screen/print display resolution.

Best regards,
-- 
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | Geospatial Programmer for Rent



More information about the Gdal-dev mailing list