<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri","sans-serif";
mso-fareast-language:EN-US;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:#0563C1;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:#954F72;
text-decoration:underline;}
span.EmailStyle17
{mso-style-type:personal-compose;
font-family:"Calibri","sans-serif";
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;
font-family:"Calibri","sans-serif";
mso-fareast-language:EN-US;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-GB" link="#0563C1" vlink="#954F72">
<div class="WordSection1">
<p class="MsoNormal">I seem to be having a few warping problems using OGRCoordinateTransformation as the warped images do not appear to have the correct co-ordinates.<o:p></o:p></p>
<p class="MsoNormal"><o:p></o:p></p>
<p class="MsoNormal">To establish what was going on I have come across a curious issue that may indicate the problems that I am having.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">On a separate machine I have QGIS 2.4.0 installed as I use this for verification as it also uses GDAL.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">I took a MrSID file (NAD83) and warped it in QGIS to a GeoTiff (WGS84).
<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">This worked successfully and produces a proper square tile with the correct co-ordinates.<o:p></o:p></p>
<p class="MsoNormal">I then copied the command line that QGIS gives you shown below:<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal" style="text-indent:36.0pt">gdalwarp -overwrite -t_srs EPSG:4326 -of GTiff E:/Stuff/Maps/georgiaville_se.sid E:/Stuff/Maps/testGDAL.tif<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">and ran this on the development machine (where I have noticed the gdal issues) in a command prompt using ‘pure’ gdal.<o:p></o:p></p>
<p class="MsoNormal">This did not give any errors and a tif file was generated.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">However when this tif from the ‘pure gdal’ was viewed, it was skewed with black borders and about 3 degrees in the longitude out and smaller error in the latitude. (These are the exact same errors that OGRCoordinateTransform gives)<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">I then did a gdalinfo on both the generated tiff files and noticed these differences:<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">From the QGIS generated file:<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Files: C:\Stuff\MrSID\Georgiaville_SE\testQGIS2.tif<o:p></o:p></p>
<p class="MsoNormal">Size is 6133, 6131<o:p></o:p></p>
<p class="MsoNormal">Origin = (-71.562566138751492,41.937520670986764)<o:p></o:p></p>
<p class="MsoNormal">Pixel Size = (0.000010201993468,-0.000010201993468)<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">From the gdal generated file:<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Files: C:\Stuff\MrSID\Georgiaville_SE\testGDAL.tif<o:p></o:p></p>
<p class="MsoNormal">Size is 6331, 6217<o:p></o:p></p>
<p class="MsoNormal">Origin = (-74.311201444644681,41.904608529793123)<o:p></o:p></p>
<p class="MsoNormal">Pixel Size = (0.000010289425691,-0.000010289425691)<o:p></o:p></p>
<p class="MsoNormal">(There were other differences in the Upper Left etc but these are the key diffs. The Coordinate System is exactly the same)<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">What is going on? Why the differences between the two? What am I doing wrong?<o:p></o:p></p>
<p class="MsoNormal">I have recently upgraded to gdal 1.11.0 and proj4 4.8.0. All the env variables etc are setup e.g. GDAL_DATA, PROJ_LIB and point to the correct directories so I must have missed something else?
<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Hope somebody can help.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Thanks<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<br>
<hr>
<font face="Arial" color="Gray" size="1">*****CONFIDENTIALITY NOTICE*****<br>
<br>
This electronic message transmission contains information which may be confidential. If you are not the intended recipient, be aware that any disclosure, copying, distribution or other use of the content of this information is prohibited. If you have received
this communication in error, please notify the sender immediately by email and delete the original message.<br>
<br>
Northrop Grumman UK Limited is company registered in England with No. 05989428, Registered Office: 2nd Floor, Clareville House, 26-27 Oxendon Street, London SW1Y 4EL.<br>
</font>
</body>
</html>