<html>
  <head>
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    Bar,<br>
    <br>
    I think you are setting the GCPs up wrongly if you want them to be
    at the corners.<br>
    <br>
    GCP(LeftDown.X, LeftDown.Y, LeftDown.Z, Height - 0.5, null, "4")
    does not have 0 before Height-0.5.<br>
    <br>
    GCPsToGeoTransform checks the special case of GCPs in rectangular
    shape and in top-left, top-right, bottom-right, bottom-left order
    and returns the exact transform the dataset has.<br>
    <br>
    I'm not sure if it makes sense to have real values for the pixel
    coordinates although they are real values.<br>
    <br>
    Best,<br>
    <br>
    Ari<br>
    <br>
    <div class="moz-cite-prefix">On 18.11.2015 09:32, Bar Ori wrote:<br>
    </div>
    <blockquote
cite="mid:538E9F517DECA94A86A940F00577EACDF836C92B@MXHFA01.esl.corp.elbit.co.il"
      type="cite">
      <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
      <meta name="Generator" content="Microsoft Word 14 (filtered
        medium)">
      <!--[if !mso]><style>v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style><![endif]-->
      <style><!--
/* Font Definitions */
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:DaxOT-Regular;}
@font-face
        {font-family:Consolas;
        panose-1:2 11 6 9 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";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p.MsoAcetate, li.MsoAcetate, div.MsoAcetate
        {mso-style-priority:99;
        mso-style-link:"Balloon Text Char";
        margin:0cm;
        margin-bottom:.0001pt;
        font-size:8.0pt;
        font-family:"Tahoma","sans-serif";}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
span.BalloonTextChar
        {mso-style-name:"Balloon Text Char";
        mso-style-priority:99;
        mso-style-link:"Balloon Text";
        font-family:"Tahoma","sans-serif";}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri","sans-serif";}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:72.0pt 90.0pt 72.0pt 90.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]-->
      <div class="WordSection1">
        <p class="MsoNormal">Hi,<o:p></o:p></p>
        <p class="MsoNormal">I noticed something that for me looks weird
          and I would like to know maybe I am doing something wrong.<o:p></o:p></p>
        <p class="MsoNormal">If not, how should I overcome this
          behavior.<o:p></o:p></p>
        <p class="MsoNormal"><o:p> </o:p></p>
        <p class="MsoNormal">I set 4 GCPs as follows:<o:p></o:p></p>
        <p class="MsoNormal"><o:p> </o:p></p>
        <p class="MsoNormal" style="text-autospace:none"><span
            style="font-size:9.5pt;font-family:Consolas;color:blue">var</span><span
            style="font-size:9.5pt;font-family:Consolas"> gcps =
            <span style="color:blue">new</span>[]<o:p></o:p></span></p>
        <p class="MsoNormal" style="text-autospace:none"><span
            style="font-size:9.5pt;font-family:Consolas">{<o:p></o:p></span></p>
        <p class="MsoNormal" style="text-autospace:none"><span
            style="font-size:9.5pt;font-family:Consolas;color:blue">new</span><span
            style="font-size:9.5pt;font-family:Consolas"> GCP(LeftUp.X,
            LeftUp.Y, LeftUp.Z, 0.5, 0.5,
            <span style="color:blue">null</span>, <span
              style="color:#A31515">"1"</span>),<o:p></o:p></span></p>
        <p class="MsoNormal" style="text-autospace:none"><span
            style="font-size:9.5pt;font-family:Consolas;color:blue">new</span><span
            style="font-size:9.5pt;font-family:Consolas"> GCP(RightUp.X,
            RightUp.Y, RightUp.Z, Width - 0.5, 0.5,
            <span style="color:blue">null</span>, <span
              style="color:#A31515">"2"</span>),<o:p></o:p></span></p>
        <p class="MsoNormal" style="text-autospace:none"><span
            style="font-size:9.5pt;font-family:Consolas;color:blue">new</span><span
            style="font-size:9.5pt;font-family:Consolas">
            GCP(RightDown.X, RightDown.Y, RightDown.Z, Width - 0.5,
            Height - 0.5,
            <span style="color:blue">null</span>, <span
              style="color:#A31515">"3"</span>),<o:p></o:p></span></p>
        <p class="MsoNormal" style="text-autospace:none"><span
            style="font-size:9.5pt;font-family:Consolas;color:blue">new</span><span
            style="font-size:9.5pt;font-family:Consolas">
            GCP(LeftDown.X, LeftDown.Y, LeftDown.Z, Height - 0.5,
            <span style="color:blue">null</span>, <span
              style="color:#A31515">"4"</span>)<o:p></o:p></span></p>
        <p class="MsoNormal" style="text-autospace:none"><span
            style="font-size:9.5pt;font-family:Consolas">};<o:p></o:p></span></p>
        <p class="MsoNormal" style="text-autospace:none"><span
            style="font-size:9.5pt;font-family:Consolas"><o:p> </o:p></span></p>
        <p class="MsoNormal" style="text-autospace:none"><span
            style="font-size:9.5pt;font-family:Consolas">And when I am
            doing as follows:<o:p></o:p></span></p>
        <p class="MsoNormal" style="text-autospace:none"><span
            style="font-size:9.5pt;font-family:Consolas"><o:p> </o:p></span></p>
        <p class="MsoNormal" style="text-autospace:none"><span
            style="font-size:9.5pt;font-family:Consolas;color:blue">var</span><span
            style="font-size:9.5pt;font-family:Consolas"> geotransform =
            <span style="color:blue">new</span> <span
              style="color:blue">double</span>[6];<o:p></o:p></span></p>
        <p class="MsoNormal" style="text-autospace:none"><span
            style="font-size:9.5pt;font-family:Consolas">Gdal.GCPsToGeoTransform(gcps,
            geotransform, 0)<o:p></o:p></span></p>
        <p class="MsoNormal" style="text-autospace:none"><span
            style="font-size:9.5pt;font-family:Consolas"><o:p> </o:p></span></p>
        <p class="MsoNormal" style="text-autospace:none"><span
            style="font-size:9.5pt;font-family:Consolas">Or (after using
            dataSet.SetGCPs(gcps, projection) :<o:p></o:p></span></p>
        <p class="MsoNormal" style="text-autospace:none"><span
            style="font-size:9.5pt;font-family:Consolas"><o:p> </o:p></span></p>
        <p class="MsoNormal" style="text-autospace:none"><span
            style="font-size:9.5pt;font-family:Consolas;color:blue">var</span><span
            style="font-size:9.5pt;font-family:Consolas"> geotransform =
            <span style="color:blue">new</span> <span
              style="color:blue">double</span>[6];<o:p></o:p></span></p>
        <p class="MsoNormal" style="text-autospace:none"><span
            style="font-size:9.5pt;font-family:Consolas">dataSet.GetGeoTransform(geotransform);<o:p></o:p></span></p>
        <p class="MsoNormal" style="text-autospace:none"><span
            style="font-size:9.5pt;font-family:Consolas"><o:p> </o:p></span></p>
        <p class="MsoNormal" style="text-autospace:none"><span
            style="font-size:9.5pt;font-family:Consolas">So the values
            returned, are wrong.<o:p></o:p></span></p>
        <p class="MsoNormal" style="text-autospace:none"><span
            style="font-size:9.5pt;font-family:Consolas">For example, if
            the LeftUp.X was 35.01050 so the value of geotransform[0],
            which supposed to be the same value, can be 35.0082.<o:p></o:p></span></p>
        <p class="MsoNormal" style="text-autospace:none"><span
            style="font-size:9.5pt;font-family:Consolas">The same with
            all the geotransform values.<o:p></o:p></span></p>
        <p class="MsoNormal" style="text-autospace:none"><span
            style="font-size:9.5pt;font-family:Consolas">If I am getting
            from the dataset and setting again, every time it is
            changing more and more.<o:p></o:p></span></p>
        <p class="MsoNormal" style="text-autospace:none"><span
            style="font-size:9.5pt;font-family:Consolas">Is there any
            connection to the use of the “0.5”?<o:p></o:p></span></p>
        <p class="MsoNormal" style="text-autospace:none"><span
            style="font-size:9.5pt;font-family:Consolas"><o:p> </o:p></span></p>
        <p class="MsoNormal" style="text-autospace:none"><span
            style="font-size:9.5pt;font-family:Consolas">Thanks.<o:p></o:p></span></p>
        <p class="MsoNormal"><o:p> </o:p></p>
        <p class="MsoNormal" style="text-align:justify"><b><span
              style="color:#1F497D"><o:p> </o:p></span></b></p>
        <table class="MsoTableGrid"
          style="border-collapse:collapse;border:none" border="0"
          cellpadding="0" cellspacing="0">
          <tbody>
            <tr>
              <td style="width:78.0pt;border:none;border-right:solid
                #1F497D 1.0pt;padding:0cm 5.4pt 0cm 7.1pt" width="104">
                <p class="MsoNormal"><b><span
style="font-size:10.0pt;font-family:"Arial","sans-serif";color:#4D4D4D"><img
                        id="Picture_x0020_2"
                        src="cid:part1.07030207.00030203@gmail.com"
                        height="33" width="98"></span></b><b><span
                      style="color:#1F497D"><o:p></o:p></span></b></p>
              </td>
              <td style="width:338.5pt;border:none;padding:0cm 5.4pt 0cm
                7.1pt" width="451">
                <p class="MsoNormal"><b><span
                      style="font-size:10.0pt;font-family:DaxOT-Regular;color:#1F497D">Ori
                      Bar |</span></b><span dir="RTL"></span><span
                    dir="RTL"></span><b><span dir="RTL"
                      style="font-size:10.0pt;font-family:"Times
                      New Roman","serif";color:#1F497D"><span
                        dir="RTL"></span><span dir="RTL"></span>
                    </span></b><span
                    style="font-size:10.0pt;font-family:DaxOT-Regular;color:gray">Software
                    Developer<o:p></o:p></span></p>
                <p class="MsoNormal"><span
                    style="font-size:10.0pt;font-family:DaxOT-Regular;color:gray">Applications
                    Development<o:p></o:p></span></p>
                <p class="MsoNormal"><span
                    style="font-size:10.0pt;font-family:DaxOT-Regular;color:gray">Elbit
                    Systems Land and C4I<o:p></o:p></span></p>
                <p class="MsoNormal"><b><span
                      style="font-size:10.0pt;font-family:DaxOT-Regular;color:#1F497D">T 
                    </span></b><span
                    style="font-size:10.0pt;font-family:DaxOT-Regular;color:gray">+972-9-8898<b>900 
                    </b></span><b><span
                      style="font-size:10.0pt;font-family:DaxOT-Regular;color:#1F497D">|</span></b><b><span
style="font-size:10.0pt;font-family:DaxOT-Regular;color:gray">  
                    </span></b><b><span
                      style="font-size:10.0pt;font-family:DaxOT-Regular;color:#1F497D">M</span></b><b><span
style="font-size:10.0pt;font-family:DaxOT-Regular;color:gray"> 
                    </span></b><span
                    style="font-size:10.0pt;font-family:DaxOT-Regular;color:gray">+972-504-734296</span><b><span
                      style="font-size:10.0pt;color:#1F497D"><o:p></o:p></span></b></p>
              </td>
            </tr>
          </tbody>
        </table>
        <p class="MsoNormal" style="text-align:justify"><b><o:p> </o:p></b></p>
        <p class="MsoNormal"><o:p> </o:p></p>
      </div>
      <div><strong></strong> </div>
      <div align="left"><strong><font face="Arial" size="2"
            color="#000080">The information in this e-mail transmission
            contains proprietary and business <br>
            sensitive information.  Unauthorized interception of this
            e-mail may constitute <br>
            a violation of law. If you are not the intended recipient,
            you are hereby <br>
            notified that any review, dissemination, distribution or
            duplication of this <br>
            communication is strictly prohibited. You are also asked to
            contact the sender <br>
            by reply email and immediately destroy all copies of the
            original message.<br>
          </font></strong></div>
      <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>