[gdal-dev] GDALProgressFunc in RasterIO not called

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

[gdal-dev] GDALProgressFunc in RasterIO not called

r.boeters
I'm using  GDALDataset::RasterIO(..)
<http://www.gdal.org/classGDALDataset.html#a80d005ed10aefafa8a55dc539c2f69da>  
to read WMS/WMTS/ECW. So not per band, nor per block.

I want to be able to terminate this process, so I thought I could pass a
GDALProgressFunc function to get intermediate status updates and return
false if the user aborts the process. However my GDALProgressFunc is never
called.

The GDALProgressFunc is defined as this:



Partial code where I'm reading the data (reading the data works fine, I get
the image; just the progress function is never called):


Am I missing anything? Or are reports to the progress function not
implemented for WM(T)S and ECW?




--
Sent from: http://osgeo-org.1560.x6.nabble.com/GDAL-Dev-f3742093.html
_______________________________________________
gdal-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/gdal-dev
Reply | Threaded
Open this post in threaded view
|

Re: GDALProgressFunc in RasterIO not called

r.boeters
I'm so sorry, the code got lost....

The GDALProgressFunc is defined as this:

int gdalProgressFunc(double dfComplete, const char *pszMessage, void
*pProgressArg)
{
  NLogger::LogMessage(Fasc(), NLogger::Info, "gdalProgressFunc called");
  return 1;
}

Partial code where I'm reading the data (reading the data works fine, I get
the image; just the progress function is never called):
UINT32 *buf = (UINT32 *)
CPLMalloc(sizeof(UINT32)*nSDestXD*nSDestYD*rasterbands);
GDALRasterIOExtraArg arg;
INIT_RASTERIO_EXTRA_ARG(arg);

QString data = "test";
arg.pfnProgress = (GDALProgressFunc)gdalProgressFunc;
arg.pProgressData = &data;

if (m_gdalDataset->RasterIO(GDALRWFlag::GF_Read, pxLeft, pyTop, abs(pxRight
- pxLeft), abs(pyTop-pyBottom), buf, nSDestXD, nSDestYD,
GDALDataType::GDT_UInt32, rasterbands, nullptr, 0, 0, 0, &arg) != CE_None)
{
  CPLFree(buf);
  return;
}



--
Sent from: http://osgeo-org.1560.x6.nabble.com/GDAL-Dev-f3742093.html
_______________________________________________
gdal-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/gdal-dev
Reply | Threaded
Open this post in threaded view
|

Re: GDALProgressFunc in RasterIO not called

Even Rouault-2
In reply to this post by r.boeters
On mercredi 11 avril 2018 02:03:27 CEST r.boeters wrote:

> I'm using  GDALDataset::RasterIO(..)
> <http://www.gdal.org/classGDALDataset.html#a80d005ed10aefafa8a55dc539c2f69da
> > to read WMS/WMTS/ECW. So not per band, nor per block.
>
> I want to be able to terminate this process, so I thought I could pass a
> GDALProgressFunc function to get intermediate status updates and return
> false if the user aborts the process. However my GDALProgressFunc is never
> called.
>
> The GDALProgressFunc is defined as this:
>
>
>
> Partial code where I'm reading the data (reading the data works fine, I get
> the image; just the progress function is never called):
>
>
> Am I missing anything? Or are reports to the progress function not
> implemented for WM(T)S and ECW?

The progress function is certainly used in the generic block-based reading
code of GDAL core, but much less in driver specific code.

From what I can see by grepping pfnProgress, it is not used by the WMS and
WMTS driver

But I do see it used in the ECW driver in a number of places. But there are
numerous code paths in it, so perhaps not in the one you trigger.

You'll have to dig more. Improvements welcome.

Eve

--
Spatialys - Geospatial professional services
http://www.spatialys.com
_______________________________________________
gdal-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/gdal-dev