Overriding GeoTIFF projection with world file

Frank Warmerdam warmerdam at POBOX.COM
Wed Feb 6 15:22:19 PST 2008


Rahkonen Jukka wrote:
> Frank,
> 
> I have been considerering the situation and yes, I think I would *really* 
> like to use this trick if it exists.  In general, wouldn't it make at least
> some sense to first check something that is fast and simple to edit or 
> rename or delete if needed (world file in this case), and not something 
> like GeoTIFF tags which are much more hard and expensive to handle?

Jukka,

No, I don't agree.  The GeoTIFF tags are already being read as the TIFF
directory is read, and so access to them is essentially free.  Looking
for the world files requires an extra operating system open attempt (or
several for the various possible extensions) which are at least moderately
expensive.  And world files can occasionally end up being applied to the wrong
file.  For instance a directory with abc.png, abc.tif and abc.wld - it is hard
to know which image file the .wld was intended to apply to.

However, I'm willing to add a mechanism to override the default behavior.
There are a couple approaches.  One is to handle this in MapServer in
the msGetGDALGeoTransform() function and it would likely be based on a layer
level PROCESSING option. The other approach is to do it in GDAL's GeoTIFF
driver and based on a configuration option (normally an environment variable
though these can also be set in .map files with a CONFIG line).

The benefit of doing it in GDAL is that it applies to all GDAL apps.  The
downside is that it only applies to GeoTIFF files.

Note, in any event, I expect this change will only go into the development
version (trunk) of either GDAL or MapServer.  I trust you are ok with building
from source or something like that?

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    | President OSGeo, http://osgeo.org



More information about the MapServer-users mailing list