[gdal-dev] translate ecw to geotiff + tfw

Even Rouault even.rouault at mines-paris.org
Wed Jun 13 14:23:24 PDT 2012


Le mercredi 13 juin 2012 23:03:12, Steve G a écrit :
> Thanks for your suggestion.
> 
> It got me thinking about the projection and other geo information stored in
> the header data within the ECW file.  I previously had trouble with various
> GIS/mapping applications being able to display ECW files properly
> (projection, extent, etc) and applications like ESRI was automatically
> creating an xml file that stores some of this information after reading the
> ECW file.  In the end, the only thing that worked for me and through
> various combinations of other applications, was for each ECW file I have
> an associated ".ecw.aux.xml", ".ecw.xml", and ".xml" file.  Each contains
> projection, extent, etc. data in a slightly different format.
> 
> When I use gdal translate with the tfw=yes creation option and choose an
> ECW file in a folder with all the other xml files, the tfw file is not
> created. However, I copied the ECW to an empty folder without the xml
> files, ran the same gdal translate function and the tfw file was created.
> 
> So, my conclusion is that the extra xml files is somehow impacting the
> creation of the tfw file. 

Well, you are making some shortcuts in the reasoning. Believe me, the fact 
that the tfw=yes creation option produces a file or not isn't the cause, but 
the consequence. However, the presence of extra xml files is certainly 
impacting how the ECW driver recognizes the georeferencing of the ECW file. If 
you follow my first suggestion, I guess you could see that gdalinfo on the ecw 
file will report certainly something different if there's a ".ecw.aux.xml" file 
or not next to the ecw file.

The behaviour of the ECW driver is the following :
- if there's a .ecw.aux.xml file that includes a valid geotransform, then this 
geotransform is used
- if not, the geotransform deduced from the header of the ecw file itself is 
used.


More information about the gdal-dev mailing list