<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META NAME="Generator" CONTENT="MS Exchange Server version 6.5.7652.24">
<TITLE>Differences in the coordinates of the origin in tfw-file and GeoTiff</TITLE>
</HEAD>
<BODY>
<!-- Converted from text/rtf format -->
<P DIR=LTR><FONT SIZE=2 FACE="Arial">Dear list,</FONT><FONT FACE="Times New Roman"> </FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Arial">while translating or warping rasterdata with gdal_translate or gdalwarp I experienced a difference in the origin of an image in the tags of the GeoTiff-header and the tfw-file.</FONT><FONT FACE="Times New Roman"> </FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Arial">The header of my original image looks as follows:</FONT><FONT FACE="Times New Roman"> </FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Arial">Driver: GTiff/GeoTIFF</FONT><FONT FACE="Times New Roman"> </FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Arial">Files: C:\test\in.tif</FONT><FONT FACE="Times New Roman"> </FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Arial">Size is 10000, 10000</FONT><FONT FACE="Times New Roman"> </FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Arial">Coordinate System is:</FONT><FONT FACE="Times New Roman"> </FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Arial">PROJCS["DHDN / 3-degree Gauss-Kruger zone 3",</FONT><FONT FACE="Times New Roman"> </FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Arial">GEOGCS["DHDN",</FONT><FONT FACE="Times New Roman"> </FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Arial">DATUM["Deutsches_Hauptdreiecksnetz",</FONT><FONT FACE="Times New Roman"> </FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Arial">SPHEROID["Bessel 1841",6377397.155,299.1528128000009,</FONT><FONT FACE="Times New Roman"> </FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Arial">AUTHORITY["EPSG","7004"]],</FONT><FONT FACE="Times New Roman"> </FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Arial">AUTHORITY["EPSG","6314"]],</FONT><FONT FACE="Times New Roman"> </FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Arial">PRIMEM["Greenwich",0],</FONT><FONT FACE="Times New Roman"> </FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Arial">UNIT["degree",0.0174532925199433],</FONT><FONT FACE="Times New Roman"> </FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Arial">AUTHORITY["EPSG","4314"]],</FONT><FONT FACE="Times New Roman"> </FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Arial">PROJECTION["Transverse_Mercator"],</FONT><FONT FACE="Times New Roman"> </FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Arial">PARAMETER["latitude_of_origin",0],</FONT><FONT FACE="Times New Roman"> </FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Arial">PARAMETER["central_meridian",9],</FONT><FONT FACE="Times New Roman"> </FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Arial">PARAMETER["scale_factor",1],</FONT><FONT FACE="Times New Roman"> </FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Arial">PARAMETER["false_easting",3500000],</FONT><FONT FACE="Times New Roman"> </FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Arial">PARAMETER["false_northing",0],</FONT><FONT FACE="Times New Roman"> </FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Arial">UNIT["metre",1,</FONT><FONT FACE="Times New Roman"> </FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Arial">AUTHORITY["EPSG","9001"]],</FONT><FONT FACE="Times New Roman"> </FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Arial">AUTHORITY["EPSG","31467"]]Origin = (3406000.000000000000000,5703000.000000000000000)</FONT><FONT FACE="Times New Roman"> </FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Arial">Pixel Size = (0.100000000000000,-0.100000000000000)</FONT><FONT FACE="Times New Roman"> </FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Arial">[ … ]</FONT> </P>
<P DIR=LTR><FONT SIZE=2 FACE="Arial">Corner Coordinates:</FONT><FONT FACE="Times New Roman"> </FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Arial">Upper Left ( 3406000.000, 5703000.000) ( 7d38'50.85"E, 51d27'18.40"N)</FONT><FONT FACE="Times New Roman"> </FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Arial">Lower Left ( 3406000.000, 5702000.000) ( 7d38'51.81"E, 51d26'46.05"N)</FONT><FONT FACE="Times New Roman"> </FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Arial">Upper Right ( 3407000.000, 5703000.000) ( 7d39'42.63"E, 51d27'19.00"N)</FONT><FONT FACE="Times New Roman"> </FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Arial">Lower Right ( 3407000.000, 5702000.000) ( 7d39'43.58"E, 51d26'46.64"N)</FONT><FONT FACE="Times New Roman"> </FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Arial">Center ( 3406500.000, 5702500.000) ( 7d39'17.22"E, 51d27'2.52"N)</FONT><FONT FACE="Times New Roman"> </FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Arial">The tfw-file coming out using the creation option -co TFW=YES (gdal_translate -co TFW=YES C:\test\in.tif C:\test\out.tif) looks like this:</FONT><FONT FACE="Times New Roman"> </FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Arial">0.1000000000</FONT><FONT FACE="Times New Roman"> </FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Arial">0.0000000000</FONT><FONT FACE="Times New Roman"> </FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Arial">0.0000000000</FONT><FONT FACE="Times New Roman"> </FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Arial">-0.1000000000</FONT><FONT FACE="Times New Roman"> </FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Arial">3406000.0499999998</FONT><FONT FACE="Times New Roman"> </FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Arial">5702999.9500000002</FONT><FONT FACE="Times New Roman"> </FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Arial">The GeoTiff-tags in this image (out.tif) is still the same as above. But amazingly there is a slight difference in x and y coordinate of approximately 5 cm between tfw and GeoTiff. This difference does occur the other way around too. For example creating a GeoTiff from a png image with a tfw-file I get the difference in the new GeoTiff-tags as well.</FONT><FONT FACE="Times New Roman"> </FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Arial">I start with those values in the tfw-file …</FONT><FONT FACE="Times New Roman"> </FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Arial">0.0846596700</FONT><FONT FACE="Times New Roman"> </FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Arial">0.0000000000</FONT><FONT FACE="Times New Roman"> </FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Arial">0.0000000000</FONT><FONT FACE="Times New Roman"> </FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Arial">-0.0846596700</FONT><FONT FACE="Times New Roman"> </FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Arial">392000.0000000000</FONT><FONT FACE="Times New Roman"> </FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Arial">5733000.0000000000</FONT><FONT FACE="Times New Roman"> </FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Arial">… and get these in the GeoTiff:</FONT><FONT FACE="Times New Roman"> </FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Arial">Origin = (391999.957670164990000,5733000.042329834800000)</FONT><FONT FACE="Times New Roman"> </FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Arial">Pixel Size = (0.084659670000000,-0.084659670000000)</FONT><FONT FACE="Times New Roman"> </FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Arial">As mentioned above, the coordinates for the origin are not the same, but the image didn't change. Does anybody know about this behavior?</FONT><FONT FACE="Times New Roman"> </FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Arial">I would be glad to hear from you.</FONT> </P>
<P DIR=LTR><FONT SIZE=2 FACE="Arial">Thanks so far and best regards</FONT><FONT FACE="Times New Roman"> </FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Arial">Andreas</FONT><BR>
</P>
<P DIR=LTR><FONT SIZE=2 FACE="Arial">Im Auftrag</FONT><FONT FACE="Times New Roman"> </FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Arial">Andreas Fischer</FONT><FONT FACE="Times New Roman"> </FONT></P>
<P DIR=LTR><FONT SIZE=2 FACE="Arial">Kreis Unna - Der Landrat<BR>
Zentrale Datenverarbeitung<BR>
Friedrich-Ebert-Straße 17<BR>
59425 Unna</FONT> </P>
<P DIR=LTR><FONT SIZE=2 FACE="Arial">Fon 02303 27-4416<BR>
Fax 02303 27-2896</FONT></P>
<pre>Diese E-Mail wurde beim Ausgang auf Viren geprueft. Wegen der potentiellen Gefahr auf den Uebertragungswegen wird zu einer Vireneingangskontrolle geraten. Eine Haftung für Virenfreiheit wird ausgeschlossen.
</pre></BODY>
</HTML>