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.65k stars 3.01k forks source link

Cropping a map based on a MBTile file or a WMTS directory fails #48710

Open fnx2k opened 2 years ago

fnx2k commented 2 years ago

What is the bug or the crash?

Error when trying to clip a layer map based on a (raster) MBTile file or a WMTS layer.

the command created by QGIS for gdal is :

gdalwarp -s_srs EPSG:3857 -t_srs EPSG:3857 -of GTiff -tr 1.0 -1.0 -tap -cutline /home/me/Cartes_GIS/gabarits.gpkg -cl mymask_CRS3857 -crop_to_cutline -co COMPRESS=JPEG -co JPEG_QUALITY=75 "crs=EPSG:3857&format&type=mbtiles&url=file:/home/me/Cartes_GIS/layerB_qgis_z6-11_v1.mbtiles" /tmp/test_cut.tif

Error is ; _ERROR 4: crs=EPSG:3857&format&type=mbtiles&url=file:///home/me/Cartes_GIS/layerB_qgis_z6-11v1.mbtiles: No such file or directory

The path passed to gdal looks unusual.

Issue reported initially on (url)https://gis.stackexchange.com/questions/431786/cropping-tile-map-into-raster-using-qgis`

Steps to reproduce the issue

1-Open a WMTS map (like Openstreetmap) 2-Create polygone which will be used as mask 3-Menu Raster>Extract> Cut with layer mask 4-set the different parameter 5-Press OK 6- Error appears

6 (expected) - A new raster layer is created by extraction and clipping and put on the Layer Menu. (scale/zoom factor may need to be is adapted)

Versions

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">

Version de QGIS | 3.16.16-Hannover | Révision du code | f5778a89df -- | -- | -- | -- Compilé avec Qt | 5.9.5 | Utilisant Qt | 5.9.5 Compilé avec GDAL/OGR | 2.2.3 | Utilisé avec GDAL/OGR | 2.2.3 Compilé avec GEOS | 3.6.2-CAPI-1.10.2 | Utilisé avec GEOS | 3.6.2-CAPI-1.10.2 4d2925d6 Compilé avec SQLite | 3.22.0 | Fonctionne avec SQLite | 3.22.0 Version du client PostgreSQL | 10.19 (Ubuntu 10.19-0ubuntu0.18.04.1) | Version de SpatiaLite | 4.3.0a Version de QWT | 6.1.3 | Version de QScintilla2 | 2.10.2 Version de PROJ.4 : | 493 Version de l'OS | Linux Mint 19.3 Extensions Python actives | batch_gps_importer; QMetaTiles; FreehandRasterGeoreferencer; quick_map_services; lockzoom; LocatePoints; VectorBender; qad; ArcheoCAD; qtiles; MetaSearch; processing; db_manager Version de QGIS 3.16.16-Hannover Révision du code [f5778a89df](https://github.com/qgis/QGIS/commit/f5778a89df) Compilé avec Qt 5.9.5 Utilisant Qt 5.9.5 Compilé avec GDAL/OGR 2.2.3 Utilisé avec GDAL/OGR 2.2.3 Compilé avec GEOS 3.6.2-CAPI-1.10.2 Utilisé avec GEOS 3.6.2-CAPI-1.10.2 4d2925d6 Compilé avec SQLite 3.22.0 Fonctionne avec SQLite 3.22.0 Version du client PostgreSQL 10.19 (Ubuntu 10.19-0ubuntu0.18.04.1) Version de SpatiaLite 4.3.0a Version de QWT 6.1.3 Version de QScintilla2 2.10.2 Version de PROJ.4 : 493 Version de l'OS Linux Mint 19.3 Extensions Python actives batch_gps_importer; QMetaTiles; FreehandRasterGeoreferencer; quick_map_services; lockzoom; LocatePoints; VectorBender; qad; ArcheoCAD; qtiles; MetaSearch; processing; db_manager **same issue reported on 3.24** ### Supported QGIS version - [ ] I'm running a supported QGIS version according to the roadmap. ### New profile - [ ] I tried with a new QGIS profile ### Additional context
Pedro-Murteira commented 2 years ago

@fnx2k Can you still reproduce the bug even on a new profile?

alexbruy commented 2 years ago

@Pedro-Murteira this is not related to new/old profile. The thing is that Processing GDAL provider does not support such datasources. It is not a bug, but feature request.

Actually this is the same as #15322.

github-actions[bot] commented 2 years ago

The QGIS project highly values your report and would love to see it addressed. However, this issue has been left in feedback mode for the last 14 days and is being automatically marked as "stale". If you would like to continue with this issue, please provide any missing information or answer any open questions. If you could resolve the issue yourself meanwhile, please leave a note for future readers with the same problem and close the issue. In case you should have any uncertainty, please leave a comment and we will be happy to help you proceed with this issue. If there is no further activity on this issue, it will be closed in a week.

fnx2k commented 2 years ago

@fnx2k Can you still reproduce the bug even on a new profile?

Yes. Same behavior.