[gdal-dev] Setting the georeferencing priority for GDAL
Jukka Rahkonen
jukka.rahkonen at mmmtike.fi
Sun Oct 27 09:02:40 PDT 2013
Hi,
Sometimes an image can have several and ambiguous metadata for
georeferencing. Mapserver has a method to deal with ambiguous internal
geotiff metadata and world files and user can override the internal metadata
by using PROCESSING "EXTENT_PRIORITY=WORLD" in the mapfile.
http://www.mapserver.org/input/raster.html#special-processing-directives.
I thought it was PROCESSING "EXTENT_PRIORITY=WORLDFILE" but perhaps both
keywords are supported.
I wonder if GDAL supports this same worldfile override with some secret
config option. At least it is not listed on page
http://trac.osgeo.org/gdal/wiki/ConfigOptions.
I can also see that GDAL does have a config option GMLJP2OVERRIDE but I
could not easily find what is is doing.
And finally when I was playing with a "gdal_edit.py" utility I discovered
that there are at least 4 ways to georeference a JPEG2000 file:
- use worldfile .wld or .j2w
- use internal GeoJP2 (GeoTIFF) georeferencing
- use internal GML georeferencing
- use an external .aux.xlm file
I noticed that command
python gdal_edit.py -a_srs epsg:3067 metajp2test.jp2
was creating a file names "metajp2test.jp2.aux" which does contain the right
georeferencing data. However, if I run gdalinfo it is looking for the
internal GeoJP2 metadata and it reports that my JPEG2000 file is still using
an unknown projection.
This feels a bit messy. Perhaps there is a need to have a GDAL wide config
option for what metadata to search and use for georeferencing. In my case I
would like to set it to use "external GDAL aux.xml". In addition, I think
that this setting should be made safe so that if aux.xml file is not found
then the image is considered to be without georeferencing. Or perhaps the
config option could take a list like "auxiliary_xml,GeoJP2" with all the
acceptable alternatives in priority order.
-Jukka Rahkonen-
More information about the gdal-dev
mailing list