<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <div class="moz-cite-prefix">Frank,<br>
      <br>
      Things are better, now, but not quite there for me.<br>
      Still not able to transform pixel/line to PCS space.<br>
      (the listgeo dump is, below)<br>
      <br>
      I think the problem is that there is no definition of the<br>
      <pre>ModelPixelScaleTag

</pre>
      It seems that this tag, together with the ModelTiepointTag,<br>
      is how an affine transformation is inferred.  Or by directly<br>
      setting <br>
      <pre>ModelTransformationTag</pre>
      which I could do with GDALDataset's SetGeoTransform()<br>
      method (for defining 2D affine transformations).<br>
      <br>
      The GTiffDataset class is hidden from users of GDAL,<br>
      being defined in the cpp file frmts/gtiff/geotiff.cpp .<br>
      Is there a way to directly set the tags of a GeoTIFF<br>
      GDAL Dataset?  Or, would this break GDAL's useful<br>
      ability of uniformly dealing with the many different<br>
      dataset formats?<br>
      <br>
      <br>
      ------------------------<br>
      <br>
      I changed the call to SetGCPs, as you suggested:<br>
      <br>
      dataset->SetGCPs( 3,<br>
                            gcps,<br>
                            wkt )<br>
      <br>
      where wkt is the equirectangular projection defined<br>
      below, in an earlier email.  Here is the listgeo dump:<br>
      <br>
      ////////////////////// listgeo dump /////////////////////////<br>
      Geotiff_Information:<br>
         Version: 1<br>
         Key_Revision: 1.0<br>
         Tagged_Information:<br>
            ModelTiepointTag (6,3):<br>
               0                249              0                <br>
               0                0                0                <br>
               399              249              0                <br>
               1000             0                0                <br>
               0                0                0                <br>
               0                2000             0                <br>
            End_Of_Tags.<br>
         Keyed_Information:<br>
            GTModelTypeGeoKey (Short,1): ModelTypeProjected<br>
            GTRasterTypeGeoKey (Short,1): RasterPixelIsPoint<br>
            GTCitationGeoKey (Ascii,8): "NoWhere"<br>
            GeographicTypeGeoKey (Short,1): GCS_WGS_84<br>
            GeogCitationGeoKey (Ascii,7): "WGS 84"<br>
            GeogAngularUnitsGeoKey (Short,1): Angular_Degree<br>
            GeogSemiMajorAxisGeoKey (Double,1): 6378137          <br>
            GeogInvFlatteningGeoKey (Double,1): 298.257224       <br>
            ProjectedCSTypeGeoKey (Short,1): User-Defined<br>
            ProjectionGeoKey (Short,1): User-Defined<br>
            ProjCoordTransGeoKey (Short,1): CT_Equirectangular<br>
            ProjLinearUnitsGeoKey (Short,1): Linear_Meter<br>
            ProjStdParallel1GeoKey (Double,1): 0                <br>
            ProjFalseEastingGeoKey (Double,1): 0                <br>
            ProjFalseNorthingGeoKey (Double,1): 0                <br>
            ProjCenterLongGeoKey (Double,1): 0                <br>
            ProjCenterLatGeoKey (Double,1): 0                <br>
            End_Of_Keys.<br>
         End_Of_Geotiff.<br>
      <br>
      Projection Method: CT_Equirectangular<br>
         ProjCenterLatGeoKey: 0.000000 (  0d 0' 0.00"N)<br>
         ProjCenterLongGeoKey: 0.000000 (  0d 0' 0.00"E)<br>
         ProjFalseEastingGeoKey: 0.000000 m<br>
         ProjFalseNorthingGeoKey: 0.000000 m<br>
      GCS: 4326/WGS 84<br>
      Datum: 6326/World Geodetic System 1984<br>
      Ellipsoid: 7030/WGS 84 (6378137.00,6356752.31)<br>
      Prime Meridian: 8901/Greenwich (0.000000/  0d 0' 0.00"E)<br>
      Projection Linear Units: 9001/metre (1.000000m)<br>
      <br>
      Corner Coordinates:<br>
       ... unable to transform points between pixel/line and PCS space<br>
      ////////////////////////////////////////////////////////////<br>
      <br>
      This is much better, but, still missing the pixel/line <-->
      PCS<br>
      transformation (as noted, above).<br>
      <br>
      <br>
      On 11/07/2013 07:32 AM, Frank Warmerdam wrote:<br>
    </div>
    <blockquote
cite="mid:CA+YzLBeuiJc1d3sZH5bTf9MbxQoyixh2OB--EZhGMN2KmRPy0A@mail.gmail.com"
      type="cite">
      <div dir="ltr">
        <div>Norman,<br>
          <br>
          My apologies.  The GCP projection is actually supposed to be
          passed as the third value in the SetGCPs call - where you have
          passed the string "Richmond".  Instead pass the whole WKT
          strings for the coordinate system.<br>
          <br>
        </div>
        Best regards,<br>
        Frank<br>
      </div>
      <div class="gmail_extra"><br>
        <br>
        <div class="gmail_quote">On Wed, Nov 6, 2013 at 4:00 PM, Norman
          Goldstein <span dir="ltr"><<a moz-do-not-send="true"
              href="mailto:normvcr@telus.net" target="_blank">normvcr@telus.net</a>></span>
          wrote:<br>
          <blockquote class="gmail_quote" style="margin:0 0 0
            .8ex;border-left:1px #ccc solid;padding-left:1ex">
            <div bgcolor="#FFFFFF" text="#000000">
              <div>Frank, <br>
                <br>
                I am using GDAL<br>
                Version     : 1.9.2<br>
                <br>
                so maybe that is why I do not see the method
                SetGCPProjection().<br>
                <br>
                I think you have convinced me, though, to calculate the
                6 coefficients directly,<br>
                and then call SetGeoTransform().  Will let you guys know
                how this works out<br>
                for me.<br>
                <br>
                Thank you,<br>
                Norm
                <div>
                  <div class="h5"><br>
                    <br>
                    <br>
                    On 11/06/2013 01:51 PM, Frank Warmerdam wrote:<br>
                  </div>
                </div>
              </div>
              <div>
                <div class="h5">
                  <blockquote type="cite">
                    <div dir="ltr">Norman,
                      <div><br>
                      </div>
                      <div>I believe you want to call SetGCPProjection()
                        instead of SetProjection() when using GCPs
                        instead of an affine transform. </div>
                      <div><br>
                      </div>
                      <div>Best regards,</div>
                      <div>Frank</div>
                      <div><br>
                      </div>
                    </div>
                    <div class="gmail_extra"><br>
                      <br>
                      <div class="gmail_quote">On Wed, Nov 6, 2013 at
                        1:23 PM, Norman Goldstein <span dir="ltr"><<a
                            moz-do-not-send="true"
                            href="mailto:normvcr@telus.net"
                            target="_blank">normvcr@telus.net</a>></span>
                        wrote:<br>
                        <blockquote class="gmail_quote" style="margin:0
                          0 0 .8ex;border-left:1px #ccc
                          solid;padding-left:1ex">I have created a
                          geotiff file using the "GTiff" driver, and
                          have successfully set options for it to be a
                          strips file with no compression.  Also,
                          successfully called the functions<br>
                          <br>
                          dataset->SetMetadataItem( "AREA_OR_POINT",<br>
                                                                     
                          "Point",<br>
                                                                     
                           nullptr ) )<br>
                          <br>
                          and<br>
                          <br>
                          dataset->SetGCPs( 3,<br>
                                                         gcps,<br>
                                                         "Richmond" )<br>
                          <br>
                          Here is the listgeo dump:<br>
                          <br>
                          ############# listgeo dump ##############<br>
                          Geotiff_Information:<br>
                             Version: 1<br>
                             Key_Revision: 1.0<br>
                             Tagged_Information:<br>
                                ModelTiepointTag (6,3):<br>
                                   0                249              0<br>
                                   0                0                0<br>
                                   399              249              0<br>
                                   1000             0                0<br>
                                   0                0                0<br>
                                   0                2000             0<br>
                                End_Of_Tags.<br>
                             Keyed_Information:<br>
                                GTRasterTypeGeoKey (Short,1):
                          RasterPixelIsPoint<br>
                                End_Of_Keys.<br>
                             End_Of_Geotiff.<br>
                          <br>
                          <br>
                          Corner Coordinates:<br>
                           ... unable to transform points between
                          pixel/line and PCS space<br>
                          #####################################<br>
                          <br>
                          I also set the reference system using the
                          following code:<br>
                          <br>
                          /////////////////////// c++ code
                          ////////////////////////////<br>
                            OGRSpatialReference oSRS;<br>
                            oSRS.SetProjCS( "NoWhere" );<br>
                            oSRS.SetWellKnownGeogCS( "WGS84" );<br>
                            oSRS.SetEquirectangular( 0.0,        //
                          Centre lat<br>
                                         0.0,        // Centre lon<br>
                                         0.0,   // False Easting<br>
                                         0.0 ); // False Northing<br>
                          <br>
                            char* wkt = nullptr;<br>
                          <br>
                            if( OGRERR_NONE != oSRS.exportToPrettyWkt(
                          &wkt ) )<br>
                            {<br>
                               error...<br>
                            }<br>
                          <br>
                            if( CE_Failure == dataset->SetProjection(
                          wkt ) )<br>
                            {<br>
                             error...<br>
                            }<br>
///////////////////////////////////////////////////////////////<br>
                          <br>
                          So, why is listgeo not able to transform
                          points between pixel/line and PCS space?<br>
                          <br>
                          I am happy to upload a full working example if
                          needed.<br>
                          <br>
                          Thank you.<br>
                          <br>
                          <br>
                          <br>
                          <br>
                          <br>
                          <br>
                          <br>
                          <br>
                          <br>
                          <br>
                          <br>
                          <br>
_______________________________________________<br>
                          gdal-dev mailing list<br>
                          <a moz-do-not-send="true"
                            href="mailto:gdal-dev@lists.osgeo.org"
                            target="_blank">gdal-dev@lists.osgeo.org</a><br>
                          <a moz-do-not-send="true"
                            href="http://lists.osgeo.org/mailman/listinfo/gdal-dev"
                            target="_blank">http://lists.osgeo.org/mailman/listinfo/gdal-dev</a><br>
                        </blockquote>
                      </div>
                      <br>
                      <br clear="all">
                      <div><br>
                      </div>
                      -- <br>
---------------------------------------+--------------------------------------<br>
                      I set the clouds in motion - turn up   | Frank
                      Warmerdam, <a moz-do-not-send="true"
                        href="mailto:warmerdam@pobox.com"
                        target="_blank">warmerdam@pobox.com</a><br>
                      light and sound - activate the windows | <a
                        moz-do-not-send="true"
                        href="http://pobox.com/%7Ewarmerdam"
                        target="_blank">http://pobox.com/~warmerdam</a><br>
                      and watch the world go round - Rush    |
                      Geospatial Software Developer<br>
                    </div>
                  </blockquote>
                  <br>
                </div>
              </div>
            </div>
            <br>
            _______________________________________________<br>
            gdal-dev mailing list<br>
            <a moz-do-not-send="true"
              href="mailto:gdal-dev@lists.osgeo.org">gdal-dev@lists.osgeo.org</a><br>
            <a moz-do-not-send="true"
              href="http://lists.osgeo.org/mailman/listinfo/gdal-dev"
              target="_blank">http://lists.osgeo.org/mailman/listinfo/gdal-dev</a><br>
          </blockquote>
        </div>
        <br>
        <br clear="all">
        <br>
        -- <br>
---------------------------------------+--------------------------------------<br>
        I set the clouds in motion - turn up   | Frank Warmerdam, <a
          moz-do-not-send="true" href="mailto:warmerdam@pobox.com"
          target="_blank">warmerdam@pobox.com</a><br>
        light and sound - activate the windows | <a
          moz-do-not-send="true" href="http://pobox.com/%7Ewarmerdam"
          target="_blank">http://pobox.com/~warmerdam</a><br>
        and watch the world go round - Rush    | Geospatial Software
        Developer<br>
      </div>
    </blockquote>
    <br>
  </body>
</html>