<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<div class="moz-cite-prefix">To Tim Southern -<br>
<br>
GDAL uses several different methods find information to
georeference tiff files (Disclaimer: I'm not at all familiar with
THE GDAL codebase and just had a brief look at the relevant c++
files):<br>
<ol>
<li>GDAL look for georeference information embedded in the tiff
file and will use it to georeference the file.</li>
<li>If no 1 fails it will look for a corresponding .twf or
similar named files and read 6 parameters from it to establish
affine transformations to/from the "pixel" coordinate system
and the "world" coordinate system.<br>
</li>
<li>If no 2 fails it will look for a corresponding .tab file,
read the ground control points (GCP) and establish the
transformations using these GCP's. <br>
</li>
</ol>
So, if your tiff file doesn't contain embedded information, GDAL
wil use the twf file.<br>
<br>
However: (And now I'm making some big assumptions):<br>
<ul>
<li>I assume the size of the tiff file is 4724 x 4724</li>
<li>I assume the upper leftmost _egde_ of the image is at
position 459000,181000 in the coordinate system. </li>
<li>I assume the lower rightmost _edge_ of the image is at
position 460000,180000 in the coordinate system, making the
tiff file 1000 x 1000 m in size in "world" coordinates</li>
</ul>
<p>This will make the pixel height and width approx. 0.2116850127
meters, not 0.21168 as implied in the twf file.<br>
</p>
<p><b>If</b> my assumptions are correct both the tfw and the
tab-file contains incorrect parameters. The twf should look like
this:<br>
</p>
<p>0.2116850127<br>
0.0<br>
0.0<br>
-0.2116850127<br>
459000.10584250635<br>
180999.89415749365<span style="color: rgb(34, 34, 34);
font-family: helvetica, arial, sans-serif; font-size: 30px;
font-style: normal; font-variant: normal; font-weight: 100;
letter-spacing: normal; line-height: 33.333335876464844px;
orphans: auto; text-align: left; text-indent: 0px;
text-transform: none; white-space: nowrap; widows: auto;
word-spacing: 0px; -webkit-text-stroke-width: 0px;
background-color: rgb(255, 255, 255); display: inline
!important; float: none;"></span></p>
<p>The translation parameters (last 2 lines) is defined from the
center of the pixel, not the edge<br>
</p>
<p>The tab file should look like this:<br>
</p>
!table<br>
!version 300<br>
!charset WindowsLatin1<br>
Definition Table<br>
File "02SU5980.tif"<br>
Type "RASTER"<br>
(459000.10584250635, 180999.89415749365) (0,0) Label "Pt 1",<br>
(459999.89415749365, 180999.89415749365) (4723,0) Label "Pt 2",<br>
(459999.89415749365, 180000.10584250635) (4723,4723) Label "Pt
3",<br>
(459000.10584250635, 180000.10584250635) (0,4723) Label "Pt 4"<br>
CoordSys Earth Projection 8, 79, "m", -2, 49, 0.9996012717,
400000, -100000<br>
<br>
The number of decimals might be a slight "overkill" :-) <br>
(The tab file doesn't contains any kind "rectangle" definitions;
the GCP's could be placed anywhere in the image. But normally they
are defined for the corners of the image)<br>
<br>
Regards<br>
Bo Victor Thomsen<br>
Aestas-GIS<br>
Denmark<br>
<br>
Den 20-01-2014 11:02, Tim Southern skrev:<br>
</div>
<blockquote
cite="mid:0D6FB1CA-3FE0-4432-BA56-1B718E93E2CA@talktalk.net"
type="cite">
<meta http-equiv="Content-Type" content="text/html;
charset=ISO-8859-1">
Dear Sir/Madame,
<div><br>
</div>
<div>I have recently downloaded a number of historic analogue maps
which have associated .twf and .tab files. I notice that both
these text files are required by GDAL for geo-referencing
according to the information given on the appropriate web page
for inputing tiff/geotiff files.</div>
<div><br>
</div>
<div>In this particular case the two files are not compatible with
each telling the system slightly different things. I have
copied the contents below. How will GDAL handle this situation?</div>
<div><br>
</div>
<div>Thanks</div>
<div><br>
</div>
<div>Tim Southern</div>
<div><br>
</div>
<div>.tab file</div>
<div><br>
</div>
<div>
<div>
<div><font color="#0056d6">!table</font></div>
<div><font color="#0056d6">!version 300</font></div>
<div><font color="#0056d6">!charset WindowsLatin1</font></div>
<div><font color="#0056d6"><br>
</font></div>
<div><font color="#0056d6">Definition Table</font></div>
<div><font color="#0056d6"> File "02SU5980.tif"</font></div>
<div><font color="#0056d6"> Type "RASTER"</font></div>
<div><font color="#0056d6"> (459000, 181001) (0,0) Label "Pt
1",</font></div>
<div><font color="#0056d6"> (459999, 181001) (4723,0) Label
"Pt 2",</font></div>
<div><font color="#0056d6"> (459999, 180001) (4723,4723)
Label "Pt 3",</font></div>
<div><font color="#0056d6"> (459000,180001) (0,4723) Label
"Pt 4"</font></div>
<div><font color="#0056d6"> CoordSys Earth Projection 8, 79,
"m", -2, 49, 0.9996012717, 400000, -100000</font></div>
</div>
<div><br>
</div>
<div><br>
</div>
<div>and the .twf file is</div>
<div><br>
</div>
<div><font color="#0042aa">0.21168000</font></div>
<div><font color="#0042aa">0.0000</font></div>
<div><font color="#0042aa">0.0000</font></div>
<div><font color="#0042aa">-0.21168000</font></div>
<div><font color="#0042aa">459000.00000000</font></div>
<div><font color="#0042aa">181000.00000000</font></div>
<div>
<div><br class="webkit-block-placeholder">
</div>
<div>The .tab file gives coordinates for the pixel 0, 0 as <font
color="#e63b7a">459000, 181001</font> whereas the .twf
file defines the same pixel as <font color="#e63b7a">459000,
181000</font>.</div>
<div>The .tab file gives coordinates for the pixel 4723,0 as <font
color="#e63b7a">459999, 181001</font> whereas the .twf
gives the same pixels as <font color="#e63b7a">459999.76464,
181000</font>.</div>
<div>The .tab file gives coordinates for the pixel 4723, 4723
as <font color="#e63b7a">459999, 180001</font> whereas .twf
file gives same point as <font color="#e63b7a">459999.76464,
180000.23536</font></div>
<div>The .tab file gives coordinates for the pixel 0, 4723 as <font
color="#e63b7a">459000, 180001</font> whereas .twf file
gives same point as <font color="#e63b7a">459000,
180000.23536</font></div>
<div><br>
</div>
<div>Another obvious difference is .tab file define a
rectangle <font color="#e63b7a">999 by 1000</font> metres
whereas the .twf file defines a square <font color="#e63b7a">999.76464
by 999.76464</font> metres.</div>
</div>
</div>
<div><br>
</div>
<br>
<br>
<div>
<div>Tim Southern</div>
<div>17, Park Close,</div>
<div>Sonning Common,</div>
<div>Oxfordshire</div>
<div>RG4 9RY</div>
<div><br>
</div>
<br class="Apple-interchange-newline">
</div>
<br>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
gdal-dev mailing list
<a class="moz-txt-link-abbreviated" href="mailto:gdal-dev@lists.osgeo.org">gdal-dev@lists.osgeo.org</a>
<a class="moz-txt-link-freetext" href="http://lists.osgeo.org/mailman/listinfo/gdal-dev">http://lists.osgeo.org/mailman/listinfo/gdal-dev</a></pre>
</blockquote>
<br>
</body>
</html>