Opened 16 years ago

Last modified 16 years ago

#2807 new enhancement

overriding worldfile with GDAL

Reported by: mko Owned by: wamerdam
Priority: normal Milestone:
Component: GDAL Support Version: 5.2
Severity: normal Keywords:
Cc: m.kofahl@…

Description

In 5.2.0 there's a new processing instruction in 5.2.0 'EXTENT_PRIORITY=WORLDFILE'. In rare cases (read only volumes with tiffs without tfw) one may even have to specify another path where the tfw resides.

A workaround uses a new processing instruction 'WORLDFILE' which can be set in the mapfile 'PROCESSING "WORLDFILE=/tmp/file.tfw"'. msGetGDALGeoTransform():

/* -------------------------------------------------------------------- */
/*      Do we want to override GDAL with a worldfile if one is present? */
/* -------------------------------------------------------------------- */

... EXTENT_PRIORITY ...

    worldfile = CSLFetchNameValue( layer->processing,
                                   "WORLDFILE" );

    if( worldfile != NULL
        && msBuildPath(szPath, map->mappath, worldfile) != NULL
        && strrchr(szPath,'.') != NULL )
    {
         char *extension = strdup(strrchr(szPath,'.')+1);
         strrchr(szPath,'.')[0] = '\0';

         if( GDALReadWorldFile(szPath, extension,
                                 padfGeoTransform) )
         {
            msDebug("msGetGDALGeoTransform(): Using alternative worldfile %s.%s\n", szPath, extension);
            return MS_SUCCESS;
         }
    }

One may combine it with EXTENT_PRIORITY.

Attachments (1)

mapdrawgdal.patch (1.4 KB ) - added by mko 15 years ago.
supports multiple world files

Download all attachments as: .zip

Change History (2)

comment:1 by sdlime, 16 years ago

Component: MapServer C LibraryGDAL Support
Owner: changed from sdlime to wamerdam

by mko, 15 years ago

Attachment: mapdrawgdal.patch added

supports multiple world files

Note: See TracTickets for help on using tickets.