tiff2geotiff - Insert georeferencing and dates into a tiff file


tiff2geotiff [options] inputFile outputFile


tiff2geotiff reads a tiff file and converts it to a geotiff (georeferenced tiff) file. tiff2geotiff can insert geo-referencing as well as date/time stamps into the input file. The geo-referencing and date information can be specified for a single image, or for a sequence of images in a multi-directory tiff file.

tiff2geotiff is modified from the geo-tiff application geotifcp, and it supports many options of that program. Type ``tiff2geotiff -h'' to see all the available command-line options. Below are listed all the options needed for doing the tiff to geotiff conversion needed by VAPOR.


-4 <``proj string''>
This option specifies a map projection using a PROJ4 projection string. This string must be enclosed in quotes, and consists of several keyword/value pairs of the form ``+key=value''. The full set of PROJ4 key/value pairs can be found at the PROJ4 wiki http://trac.osgeo.org/proj/wiki . For example, a longitude/latitude projection on a spherical earth is specified as ``+proj=latlong +ellps=sphere''. tiff2geotiff supports Lambert conformal conic, Mercator, Longitude/Latitude, and polar stereographic projections.

-m <date/time-position_filename>
This option requires option -4 above. This option specifies a file that contains georeferencing information and date/time stamps for each of the directories in the tiff file. Each line of the file date/time-position_filename is of the form:
        Date/Time llx lly urx ury pllx plly purx pury

is a WRF-style date/time stamp in the form yyyy-mm-dd_hh:mm:ss

        llx lly urx ury

are the longitude (x) and latitude (y) of the lower-left and upper-right corners of the plot area in the image. This supports georeferencing of images that consist of a plot area surrounded by additional annotation, enabling the latitude and longitude of the plot area to be specified.

        pllx plly purx pury

are the relative positions of the plot area corners in the full page, and are values between 0.0 and 1.0 . The georeferencing is such that the plot area will fit exactly at the specified latitude and longitude; however the image will extend further than the plot area if pllx, plly, purx, and pury are not 0.0, 0.0, 1.0, and 1.0 respectively.

-M <date/time_filename>
This option specifies a file that contains a date/time stamp for each directory in the tiff file. The option ``-4'' must not be specified. Each line of the file date/time_filename is a WRF-style date time stamp of the form:

-n <``llx lly urx ury''>
This option requires four values in quotes. This specifies the same latitude and longitude extents for all directories in the file. Option -4 must be specified. This option is ignored if option -m is specified.

-c compressOption
This option (inherited from geotifcp) is useful in controlling the compression of the resulting geotiff file. Useful values of compressOption, for use with VAPOR, include:
        none    will result in no compression in the output file
        lzw     will result in Lempel-Ziv & Welch encoding

Print a usage statement and then exit.


The command

tiff2geotiff -4 "+proj=latlong +ellps=sphere" -n "0 -60 90 -30" infile.tif outfile.gtif

will produce an output geotiff file outfile.gtif that will have the same images as infile.tif, but will in addition be geo-referenced to use a long/lat map projection, and will map the images to the rectangle with lon/lat corners at (0,-60) and (90,-30).

tiff2geotiff -4 "+proj=lcc +lon_0=-30 +lat_1=40 +lat2=60 +ellps=sphere" -m datetimecoordfile.txt infile.tif outfile.gtif

will produce an output geotiff file outfile.gtif that will contain the same image or images as infile.tif, but will in addition be geo-referenced to use a Lambert conformal conic map projection. The Lambert projection will be centered at longitude -30, with the projection being true at latitudes 40 and 60. The resulting geotiff image will have date/time stamps and lon/lat extents as specified in the file datetimecoordfile.txt. The file datetimecoordfile.txt must have one line for each image in the tiff file, and each line must consist of a date/time stamp followed by 8 floating point values as in the following:

        2009-07-21_13:30:00 -100 30 -50 50 0.1 0.1 0.9 0.9

In the above line the first value is a date/time stamp. The next four values indicate that the longitude of the plot area of the image goes from -100 to -50 and the latitude goes from 30 to 50. The last four values indicate that the actual image is larger than the plot area, with the plot area going from 10% inside the lower-left corner of the image to 10% inside the upper-right corner.


The PROJ4 wiki http://trac.osgeo.org/proj/wiki


Last updated on Date: 2009/07/22 15:56:16