Ticket #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
Change History
Note: See
TracTickets for help on using
tickets.

