-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Raster MTR improvements - part one #3334
Conversation
The improvement allows immediate cancellation of raster rendering in progress. Until now, even when map rendering got cancelled (e.g. by zooming of panning canvas), the GUI got blocked while waiting for raster layers to finish their rendering (only vector layers have had support for cancellation). This should allow for much smoother user experience while browsing maps including rasters. The cancellation is supported currently by WMS/WMTS and WCS providers. GDAL provider may also get support thanks to improvements in GDAL 2. Funded by Land Information New Zealand.
There are still some questions around it and I need to find some data for thorough testing (many GDAL drivers do not support cancellation)
Nice to see the doc tests are working correctly! :) |
@nyalldawson hmm actually it seems like there is a false report for QgsFeedback class - it is marked as added in 3.0 but PyQgsDocCoverage is still not happy... |
Hmm can you try making the @note immediately below the ingroup and see if that helps? |
*/ | ||
virtual QgsRasterBlock *block( int bandNo, const QgsRectangle &extent, int width, int height ) = 0; | ||
virtual QgsRasterBlock *block( int bandNo, const QgsRectangle &extent, int width, int height, QgsRasterBlockFeedback* feedback = nullptr ) = 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is technically an api break, so should be included in the api break docs.
This is exciting. @wonder-sk , @nyalldawson , will this help bringing tiled rendering (which was quickly introduced in the 2.15 dev cycle)? |
@nyalldawson Unfortunately the doc coverage test still fails for QgsFeedback... @nirvn At some point later it should also show raster tiles as they are being downloaded from WMTS - if that was your question... |
@wonder-sk , no, I meant tiled rendering of raster files. It was pretty cool when it was on qgis 2.15-dev 😄 |
👍 nice, a really good thing for a better UX! One thing I struggle is understanding the scope of the QgsFeedback object. |
Yes it is designed in a way that it may be possibly used in other parts of the code.
For now yes, although in future it may make sense to have operations/jobs/tasks that cannot be cancelled, so a more general base class may be useful.
Not sure what would be the best name. It would be worth discussing terminology for asynchronous operations / jobs / tasks in QGIS context. For now I would stick with "feedback" - we still have plenty of time to change later it when necessary... |
Awesome! Can't wait for part 2! |
... coming to cinemas in 2017 ! |
I'm seeing crashes today while panning/zooming maps which are mid-render. Backtrace is below, but it looks to me like the
|
The crash should be fixed in 23909a1 |
@wonder-sk thanks! Do you think it makes sense to remove QgsInterruptionChecker now, and replace QgsVectorLayerRendererInterruptionChecker with a QgsFeedback subclass? Seems look a lot of overlap there now. |
Yeah very good point @nyalldawson |
First part of the work to improve rendering of raster layers. With this PR, it is possible to prematurely cancel rendering of raster layers, making it possible to browse the map faster. Especially useful for rasters coming from remote servers.
Raster pipe works with an optional feedback object that can be used to signal cancellation to data providers without having to poll for a "rendering stopped" variable as like with QgsRenderContext. The feedback object may be later used also the other way round - to signal from raster data provider that some data are available and thus a preview of the raster may be produced).
Requires raster data provider support - so far available for WMS, WMTS, WCS.