Need help with TIF TILE SIZE

Brent Fraser bfraser at GEOANALYTIC.COM
Fri Jul 15 12:03:57 EDT 2005


Yar,

  The procedure in my previous email is for a single tile.  At the beginning
of your process you have 52 tiff files in a UTM zone 15 coordinate system
(see attached utm.gif).  At the end of the process you will have 52 tiff
files in a geographic coordinate system (un-projected).

If you simply issued 52 gdalwarp commands (on for each input file), you
would end up with "wedges" of no-data around the perimeter of each of the 52
new tiff files (see the red wedges in the attached latlon1.gif) due to the
projection of the data.  To fill in the four wedges you must issue the
gdalwarp command with the four images on the four sides of the first image
(see the utm23.gif).  Fro example:

gdalwarp -s_srs "+proj=utm +zone=15 +datum=NAD83" -t_srs "+proj=latlong
+datum=WGS84"  7.tif  7_latlong.tif
gdalwarp -s_srs "+proj=utm +zone=15 +datum=NAD83"   2.tif   7_latlong.tif
gdalwarp -s_srs "+proj=utm +zone=15 +datum=NAD83"   6.tif   7_latlong.tif
gdalwarp -s_srs "+proj=utm +zone=15 +datum=NAD83"   8.tif   7_latlong.tif
gdalwarp -s_srs "+proj=utm +zone=15 +datum=NAD83" 10.tif   7_latlong.tif

The resulting graphic is ONLY the area of the first tiff (#7 in my example)
with the wedges of no-data filled in.  You must now repeat the process for
the other 51 tiles.  gdalwarp does not automatically expand the extent of
the target tiff to include the total area of the four adjacent tiffs; it
only uses the data from the overlap region (the red wedges).

Some notes:

gdalwarp automatically calculates the extent of the new tiff based on the
old tiff (and the projection parameters).  You can tell it to create a tiff
covering a larger area (or smaller) by calculating the the new extent
yourself and using the -te option.

The most difficult part of the process is deciding which tiles are adjacent.
One solution is to just issue the gdalwarp command 52 times for each of the
52 tiles.  gdalwarp will not copy any data if it does not overlap the target
tiff (you may get a warning message).

An alternative to filling in the wedges is to use the OFFSITE keyword in
Mapserver's map file to specify that you want the no-data pixels to be
transparent when Mapserver reads the tiffs and renders the web image.  But
this adds to Mapserver's processing time.


Brent


----- Original Message ----- 
From: "Yar Doroshenko" <numerous at GMAIL.COM>
To: <MAPSERVER-USERS at LISTS.UMN.EDU>
Sent: Friday, July 15, 2005 9:04 AM
Subject: Re: [UMN_MAPSERVER-USERS] Need help with TIF TILE SIZE


> Brent,
>
> I have tried the mosaicking feature of gdalwarp. I tried it on 5 images
out
> of the 52 that I have. I started with the
>
> gdalwarp -s_srs "+proj=utm +zone=15 +datum=NAD83" -t_srs "+proj=latlong
> +datum=WGS84" 10_1_1.tif latlong.tif
>
> on the top left image, and then I did
>
> gdalwarp -s_srs "+proj=utm +zone=15 +datum=NAD83" 10_1_2.tif latlong.tif
> gdalwarp -s_srs "+proj=utm +zone=15 +datum=NAD83" 10_1_3.tif latlong.tif
> gdalwarp -s_srs "+proj=utm +zone=15 +datum=NAD83" 10_1_4.tif latlong.tif
> gdalwarp -s_srs "+proj=utm +zone=15 +datum=NAD83" 10_1_5.tif latlong.tif
>
> to the four consecutive images on the right.  I next tried to display them
> and what I got seemed like the first image with somewhat distorted edges.
>
> Should I start with a center image first? Would these instructions only
> work for 5 images (1 centerpiece and 4 border images)? How should I handle
> the 52 ones? They are arranged in a rectangular pattern.
>
>
> Thank you,
>
>
> Yar
-------------- next part --------------
A non-text attachment was scrubbed...
Name: utm.gif
Type: image/gif
Size: 1864 bytes
Desc: not available
Url : http://lists.osgeo.org/pipermail/mapserver-users/attachments/20050715/f1cbabe6/utm.gif
-------------- next part --------------
A non-text attachment was scrubbed...
Name: latlon1.gif
Type: image/gif
Size: 2930 bytes
Desc: not available
Url : http://lists.osgeo.org/pipermail/mapserver-users/attachments/20050715/f1cbabe6/latlon1.gif
-------------- next part --------------
A non-text attachment was scrubbed...
Name: latlon2.gif
Type: image/gif
Size: 3578 bytes
Desc: not available
Url : http://lists.osgeo.org/pipermail/mapserver-users/attachments/20050715/f1cbabe6/latlon2.gif


More information about the mapserver-users mailing list