[Mapserver-users] generating world files

Frank Warmerdam warmerdam at pobox.com
Wed Apr 16 09:09:07 EDT 2003


woodbri at swoodbridge.com wrote:
> Or similarly can we generate geoTiff output with the new OUTPUT 
> formats?
> 
> -Steve
> 
> On 16 Apr 2003 at 9:30, Heiko.Kehlenbrink at vermes.fh-o wrote:
> 
> 
>>hello all, 
>>
>>i`m wondering if it is possiple to generate a .tfw file for a rendered
>>map in mapserver, maybe like: 
>>
>>
>>$tfw = $map->getworldfile(); 
>>
>>the idea is to compose new maps with the mapserver and use them in
>>other applications. 

Steve / Heiko,

As mentioned you could create the .tfw file yourself from mapscript.

You can also use GDAL to generate TIFF files with a world file or (the
default) proper GeoTIFF files.

The OUTPUTFORMAT declaration for GeoTIFF output is something like:

OUTPUTFORMAT
   NAME gtif
   DRIVER "GDAL/GTiff"
   IMAGEMODE PC256
END

To produce a TIFF file with a world file you could use the following format:

OUTPUTFORMAT
   NAME gtif
   DRIVER "GDAL/GTiff"
   IMAGEMODE PC256
   FORMATOPTION "WORLDFILE=YES"
END

However, there is an issue with this.  Currently the MapServer cgi support
is setup to only return a single file.  So even though the above definition
will cause a TIFF file and a .tfw file to be written to the tmp directory,
the .tfw file will not normally be returned to the client.  However, if you
are just setting this up for local map processing you might still be able to
take advantage of the world file.

One thing I had been considering at one time is making it so that the GDAL
OUTPUTFORMAT driver would support a mechanism to bundle up groups of associated
files making a dataset into a .zip file before returning to the client.

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 mapserver-users mailing list