[Gdal-dev] XResolution / YResolution tags

Gérald CLETTE gerald.clette at free.fr
Wed Jul 27 18:53:25 EDT 2005


 
Hi Frank
 
I've found in the TIFF specification Rev 6.0 that the X/YResolution tags

don't have any default value.
It's also written that these tags are required for Bilevel Images,
Grayscale 
images, Palette color images as well as for RGB images.
I noticed that applications can display the images  with no care (!)
with 
these tags but it's not written that these tags can be absent.
 
I'm just trying to find how to get a default value for these tags (if
any 
but I don'tthink that it's a good idea to fx one) or a way to calculate
it.
 
Thank you
Gerald
 
"Frank Warmerdam" <fwarmerdam at gmail.com> a écrit dans le message de
news: 
931f8ea90507060759158ca8d2 at mail.gmail.com...
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>
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>
http://pobox.com/~warmerdam
and watch the world go round - Rush    | Geospatial Programmer for Rent 
 
 
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/gdal-dev/attachments/20050728/285f3d4a/attachment.html


More information about the Gdal-dev mailing list