[gdal-dev] gdal_translate gif->gtiff warning

Frank Warmerdam warmerdam at pobox.com
Tue Mar 29 12:32:20 EDT 2011


On 11-03-29 12:22 PM, Dori wrote:
> Hi,
> I am trying to convert this GIF
> https://picasaweb.google.com/izzybitsie/GDALImage?feat=directlink
> <http://aviationweather.gov/data/products/swl/ll_12_0_cl_new.gif> to gtiff.
> I used this command after assuming projection was lcc:
> *gdal_translate -of GTiff -a_srs '+proj=lcc +lon_0=-95 +lat_0=25 lat_1=25'
> -a_ullr $ulx $uly $lrx $lry ../maps/my_image.gif ../maps/my_image.tif *
>
> If I try to view the image using ImageMagick I can see it but I get a warning
> about TiffReadDirectory field tag 42112 encountered.  If I try to view the same
> image with a proprietary software then, I get the same warning but I am not
> able to see the image.
...
> Q1: is there any easy way to find out if this warning is caused because I am
> using the wrong projection?

Dori,

Tag 42112 is a custom GDAL tag for storing metadata and is unrelated
to the projection.

> Q2: Does the command I am using look OK?

The command looks plausible but from the output file it is clear
you are assigning corner coordinates that are lat/long, not LCC
projected meter coordinates.  You will likely need to first reproject
the lat/long corners into projected coordinates before you can assign
them with -a_ullr.  You could use the PROJ.4 cs2cs command or the
gdaltransform command to accomplish the reprojection from lat/long to
projected coordiantes.

> Q3: How do I get rid of the warning to try viewing the image with the
> proprietary software?

You can avoid the warning by using the commandline option:

  -co PROFILE=GEOTIFF

This instructs GDAL to avoid adding any tags not in the GeoTIFF
standard.  However, I suspect the warning isn't actually what is
interfering with use of the image.

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