qgis / QGIS

QGIS is a free, open source, cross platform (lin/win/mac) geographical information system (GIS)
https://qgis.org
GNU General Public License v2.0
10.6k stars 3.01k forks source link

[processing][xyz tiles] mask layer instead of bbox #29807

Open qgib opened 5 years ago

qgib commented 5 years ago

Author Name: Saber Razmjooei (@saberraz) Original Redmine Issue: 21992

Redmine category:processing/qgis


The tool is processing tiles in the bounding box of a layer (or other rectangle extends). This is useful in overviews. But especially in higher zoom-levels(for example zoom (19) 20/21/…)) combined with non-rectangle-like areas of interest, there is there is a risk of time-consuming rendering time without usable content. (There is a workaround to subdivide the area of interest in smaller areas. But after that users have merge mbtiles-outputs…). So it may be useful to have the option /ability to render just the tiles covering non-rectangle contents.

qgib commented 5 years ago

Author Name: Saber Razmjooei (@saberraz)


Although the UI may become a bit more complicated, it will be worth some thoughts, if there will be a differentiated selection in which zoom-levels shall be rendered at bounding-box-extends (for overviews) and in which zoom-levels shall be rendered at polygon-area-extends. This will reduce the work (and possible-user-bugs) in merging various mbtiles-files (with rectangle- and reduced-just-polygon-covering-tiles)

garrettdashnelson commented 4 years ago

Another possibility would be to skip writing to disk for transparent tiles, as has been implemented in gdal2tiles.py at #729.

brendan33 commented 3 years ago

This feature would be a really useful addition. I have a long route of bathymetry data (700+km) which when using a bbox (big orange square below) with the XYZ mbtiles means nearly all of the processing time is wasted as it's just generating and discarding empty tiles. Left for 12 hrs it had only reached 9% and produced an .mbtiles only a few mb in size! The solution was to manually draw 70+ small rectangles/extents, process individually with XYZ mbtiles and then merge mbtiles. This process was completed in ~5 hrs when the jobs were split between 4 QGIS instances. image Excuse the faded image and the black square, QGIS decided to freeze and then crash just as I took the screenshot (thankfully processing had finished!)

Even then this solution was not very efficient.

I believe if you first determine exactly which tiles will contain data then you only need to process the required tiles which would save a huge amount of processing time. In a previous project I first passed a vector of the exact extents of the raster data through tippecanoe. The resulting mbtile was then used as a list of the exact XYZ tiles that would contain raster data.