Open Georeferenced Images (.aux.xml) in ArcMap and QGIS

arcmapgeoreferencingqgisraster

We have several ArcMap georeferenced images (raster datasets) that we are attempting to open in QGIS without any luck. These are not inside of a geodatabase and are not Arcinfo Binary Grid format or Arcinfo Binary Coverages. QGIS supports GDAL rasters and the ArcMap created .aux.xml file contains the georeference points, but QGIS apparently does not recognize this file as it places my Texas image in a very small area of the Atlantic ocean off the coast of Africa (with a google maps basemap added). (THe only other files in the raster dataset are .tfwx and .ovr)

Is there something special I need to do within QGIS to apply the coordinates in the aux.xml created by ArcMap, or something else I'm missing?

Here are the contents of one such aux.xml file:

<?xml version="1.0"?>

-<PAMDataset>

<Metadata/>


-<Metadata domain="Esri">

<MDI key="PyramidResamplingType">NEAREST</MDI>

</Metadata>


-<Metadata domain="xml:ESRI" format="xml">


-<GeodataXform xmlns:typens="http://www.esri.com/schemas/ArcGIS/10.1" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="typens:PolynomialXform">

<PolynomialOrder>1</PolynomialOrder>


-<SpatialReference xsi:type="typens:ProjectedCoordinateSystem">

<WKT>PROJCS["WGS_1984_Web_Mercator_Auxiliary_Sphere",GEOGCS["GCS_WGS_1984",DATUM["D_WGS_1984",SPHEROID["WGS_1984",6378137.0,298.257223563]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]],PROJECTION["Mercator_Auxiliary_Sphere"],PARAMETER["False_Easting",0.0],PARAMETER["False_Northing",0.0],PARAMETER["Central_Meridian",0.0],PARAMETER["Standard_Parallel_1",0.0],PARAMETER["Auxiliary_Sphere_Type",0.0],UNIT["Meter",1.0],AUTHORITY["EPSG",3857]]</WKT>

<XOrigin>-22041259.177065704</XOrigin>

<YOrigin>-33265069.154224794</YOrigin>

<XYScale>135385247.70505452</XYScale>

<ZOrigin>-100000</ZOrigin>

<ZScale>10000</ZScale>

<MOrigin>-100000</MOrigin>

<MScale>10000</MScale>

<XYTolerance>0.001</XYTolerance>

<ZTolerance>0.001</ZTolerance>

<MTolerance>0.001</MTolerance>

<HighPrecision>true</HighPrecision>

<WKID>102100</WKID>

<LatestWKID>3857</LatestWKID>

</SpatialReference>


-<SourceGCPs xsi:type="typens:ArrayOfDouble">

<Double>5.994281757832141</Double>

<Double>5.6742238617780458</Double>

<Double>2.0592992159490677</Double>

<Double>4.5229583592636118</Double>

<Double>2.014907522695573</Double>

<Double>8.8668953443025202</Double>

<Double>2.8272115205686532</Double>

<Double>7.7051733542912189</Double>

</SourceGCPs>


-<TargetGCPs xsi:type="typens:ArrayOfDouble">

<Double>-10752195.345278211</Double>

<Double>3857531.2694506948</Double>

<Double>-10756947.906142347</Double>

<Double>3856205.4206410511</Double>

<Double>-10756935.616529588</Double>

<Double>3861470.3939956115</Double>

<Double>-10755980.997953685</Double>

<Double>3860058.8390891682</Double>

</TargetGCPs>

<Name/>

</GeodataXform>

</Metadata>

</PAMDataset>

Best Answer

Your best bet is to rectify the georeferenced raster and that way there will be no problem when moving between different software. Save your raster as a GeoTiff or GeoJPG and (barring raster statistics) you can dispense with both the aux and the world file.

Any file with a 'W' at the end (e.g. TFW JPW etc) is a world file. A world file that ends in an 'X' denotes an approximate world file, that is one where the transformation cannot be adequately defined within the limits of a conventional world file. Such 'approximate' world files are specific to ArcGIS and Arc uses them in conjunction with the aux.xml file, so by itself, that aux.xml will not help you (as you've discovered).

The irony is that because both ArcGIS and QGIS use GDAL to read and write rasters, they both produce aux.xml file that in theory should be compatible but in practice, because QGIS doesn't use approximate world files, relying on the aux.xml becomes a liability and not a help.

The contents of a 'proper' world file for a rectified raster will look very different to the contents of an equivalent approximate world file (the one with the X). I don't personally recommend hacking it by just chopping off the X.

One more irony (IMHO) is that georeferenced rasters that don't have world files (GeoTiff, GeoJPG etc) have all the projection and CRS information in their headers (or should do) and therefore don't need the aux file except to store raster statistics (hence my opening statement). In fact, that aux file can be a menace because as soon as you open a raster an aux is made even if you only open an image for a quick look. Arc then incorrectly thinks it knows the CRS and projection for your raster before you even georeference it. I've had situations where the aux has got out of sync with the georeferencing process (at which point your only recourse is to kill the aux).

Solution - I always rectify!