<html>
  <head>
    <meta content="text/html; charset=KOI8-R" http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <br>
    <br>
    -------- Исходное сообщение --------
    <table class="moz-email-headers-table" border="0" cellpadding="0"
      cellspacing="0">
      <tbody>
        <tr>
          <th align="RIGHT" nowrap="nowrap" valign="BASELINE">Тема: </th>
          <td>Re: [gdal-dev] Creating a VRT dataset from overviews in
            C++</td>
        </tr>
        <tr>
          <th align="RIGHT" nowrap="nowrap" valign="BASELINE">Дата: </th>
          <td>Thu, 10 May 2012 23:58:53 +0400</td>
        </tr>
        <tr>
          <th align="RIGHT" nowrap="nowrap" valign="BASELINE">От: </th>
          <td>Dmitry Baryshnikov <a class="moz-txt-link-rfc2396E" href="mailto:polimax@mail.ru">&lt;polimax@mail.ru&gt;</a></td>
        </tr>
        <tr>
          <th align="RIGHT" nowrap="nowrap" valign="BASELINE">Кому: </th>
          <td>Thomas Sevaldrud <a class="moz-txt-link-rfc2396E" href="mailto:thomas@silentwings.no">&lt;thomas@silentwings.no&gt;</a></td>
        </tr>
      </tbody>
    </table>
    <br>
    <br>
    <meta content="text/html; charset=KOI8-R" http-equiv="Content-Type">
    10.05.2012 23:14, Thomas Sevaldrud написал:
    <blockquote
cite="mid:CAJSDX1gda4W7z-xuZE7WfsDxhNM1bJe9rL5Qw1nkpLbQrOKGnw@mail.gmail.com"
      type="cite">Hi Dmitry, and thanks for your answer! <br>
    </blockquote>
    Hi Thomas!
    <blockquote
cite="mid:CAJSDX1gda4W7z-xuZE7WfsDxhNM1bJe9rL5Qw1nkpLbQrOKGnw@mail.gmail.com"
      type="cite">
      <div><br>
      </div>
      <div>I was actually looking at this patch earlier today, but I
        also wanted to see if I could solve it without patching. </div>
      <div><br>
      </div>
      <div>Will this patch be included in the official source?</div>
    </blockquote>
    My patch needs some refactoring and testing on python bindings. The
    work is going on , but not so fast as I wish. As I finished and
    commit my code, It'll be some testing period and than fixes will be
    accepted.<br>
    <blockquote
cite="mid:CAJSDX1gda4W7z-xuZE7WfsDxhNM1bJe9rL5Qw1nkpLbQrOKGnw@mail.gmail.com"
      type="cite">
      <div><br>
      </div>
      <div>Is it possible to do it the way I described in the previous
        mail?</div>
    </blockquote>
    Yes, you can try to warp and overview images (bands). You can get an
    overview of needed level from GDALRasterBand Class via GetOverview
    (int) method, but than you need to work on band basis and mixed them
    in colour image by yourself.<br>
    <blockquote
cite="mid:CAJSDX1gda4W7z-xuZE7WfsDxhNM1bJe9rL5Qw1nkpLbQrOKGnw@mail.gmail.com"
      type="cite">
      <div><br>
      </div>
      <div>Cheers,</div>
      <div>Thomas<br>
        <br>
        <div class="gmail_quote">On Thu, May 10, 2012 at 7:11 PM, Dmitry
          Baryshnikov <span dir="ltr">&lt;<a moz-do-not-send="true"
              href="mailto:polimax@mail.ru" target="_blank">polimax@mail.ru</a>&gt;</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"> 10.05.2012 19:03,
              tseval написал:
              <div>
                <div class="h5">
                  <blockquote type="cite">
                    <pre>Hi,

I'm trying to cut and reproject a large image with overviews using the c++
api. This runs extremely slow when I produce highly downsampled cutouts
covering large areas of the original image.

I understand the the Warp API doesn't use the overviews when resampling, so
I wanted to make a temporary dataset from one of the downscaled overviews
and do the warping on this dataset instead.

First of all, is this a sensible way of doing things? If so, what driver
should I use? I guess VRT? I have been trying to create a VRT by doing
something like this:

        double scaleX = (double)ovrW/origW;
        double scaleY = (double)ovrH/origH;
        GDALDataset* vrtDS = vrtDriver-&gt;Create("", ovrW, ovrH, _numBands,
_dataType, NULL);
        GDALSetProjection(vrtDS, _srcProjectionWKT);
        double geoTransform[6];
        srcDS-&gt;GetGeoTransform(geoTransform);
        geoTransform[XFM_PIXEL_SIZE_EW] = scaleX*geoTransform[XFM_PIXEL_SIZE_EW];
        geoTransform[XFM_PIXEL_SIZE_NS] = scaleY*geoTransform[XFM_PIXEL_SIZE_NS];
        vrtDS-&gt;SetGeoTransform(geoTransform);

But how am I supposed to set the bands in the VRT from the downscaled
overview bands in the original image?

Any help on this would be greatly appreciated :)


--
View this message in context: <a moz-do-not-send="true" href="http://osgeo-org.1560.n6.nabble.com/Creating-a-VRT-dataset-from-overviews-in-C-tp4965891.html" target="_blank">http://osgeo-org.1560.n6.nabble.com/Creating-a-VRT-dataset-from-overviews-in-C-tp4965891.html</a>
Sent from the GDAL - Dev mailing list archive at Nabble.com.
_______________________________________________
gdal-dev mailing list
<a moz-do-not-send="true" href="mailto:gdal-dev@lists.osgeo.org" target="_blank">gdal-dev@lists.osgeo.org</a>
<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>


</pre>
                  </blockquote>
                </div>
              </div>
              Hi,<br>
              <br>
              You can try to use this patch to enable overviews in VRT <a
                moz-do-not-send="true"
                href="http://trac.osgeo.org/gdal/ticket/2076"
                target="_blank">http://trac.osgeo.org/gdal/ticket/2076</a><br>
              or waits as I accomplish my work on fixing this situation.<a
                moz-do-not-send="true"
                href="http://trac.osgeo.org/gdal/ticket/2076"
                target="_blank"> </a><br>
              <br>
              Best regards,<br>
                  Dmitry<br>
            </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>
      </div>
    </blockquote>
    Best regards,<br>
        Dmitry<br>
    <br>
  </body>
</html>