Fwd: [gdal-dev] gdal_translate and TIFF resolutions(?)

Frank Warmerdam warmerdam at pobox.com
Thu Dec 15 16:58:11 EST 2011


Forwarding private response back to the group.

---------- Forwarded message ----------
From: Frank Warmerdam <warmerdam at pobox.com>
Date: Thu, Dec 15, 2011 at 1:56 PM
Subject: Re: [gdal-dev] gdal_translate and TIFF resolutions(?)
To: Mike O'Malley <mike.omalley at nextcentury.com>


On Thu, Dec 15, 2011 at 1:41 PM, Mike O'Malley
<mike.omalley at nextcentury.com> wrote:
> Frank,
>   Sure thing!  I've attached the output from tiffinfo and tiffdump.  Tiffinfo noted a few unknown fields with high numeric tags (34k-ish), but I don't know that those are relevant.
>   I'm using GDAL 1.8.1.  What source metadata does GDAL require to set the resolution fields?  I don't have control over the NITFs, but if there's some way I can inject that metadata into the process I'd be happy to look into it.  Or after the process, for that matter.


Mike,

The tiffinfo messages about unknown tags are not serious.
Looking at the generated file I don't see any problems with it
as far as resolution goes.  It just doesn't have any resolution
tags at all which is perfectly legitimate.   If some apps can't
consume files without resolution set then I think they are
the issue.

However, you can set it yourself like:

gdal_translate ... \
 -mo TIFFTAG_XRESOLUTION=80 \
 -mo TIFFTAG_YRESOLUTION=80 \
 -mo TIFFTAG_RESOLUTIONUNIT=2

#define     RESUNIT_NONE                1       /* no meaningful units */
#define     RESUNIT_INCH                2       /* english */
#define     RESUNIT_CENTIMETER          3       /* metric */

The above would be 80 dpi.  The tags are mentioned
in the GeoTIFF driver docs though I don't believe it is
specific about the interpretation of the resolution units.

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 Software Developer


-- 
---------------------------------------+--------------------------------------
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 Software Developer


More information about the gdal-dev mailing list