Skip to content
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

GDAL Clip Raster by Layer Mask fails when given GeoPackage layer with diacritics (accents) in the name #59573

Open
2 tasks done
hernanrr opened this issue Nov 24, 2024 · 1 comment
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! Feedback Waiting on the submitter for answers macOS

Comments

@hernanrr
Copy link

What is the bug or the crash?

In version 3.40, upon trying to clip a raster by layer mask using a GeoPackage Polygon layer with an accent in the name (e.g., "Frontera zona de interés", GDAL Warp routine fails giving the following error: ERROR 1: Failed to identify source layer from datasource. Process returned error code 1

Below the complete error log:

GDAL command:
gdalwarp -overwrite -of GTiff -tr 30.0 -30.0 -tap -cutline "/Users/ricardo/Documents/GIS/LaSiembra/Tutorial La Siembra.gpkg" -cl "Frontera zona de interés" -crop_to_cutline "/Users/ricardo/Documents/GIS/LaSiembra/DEM Reproyectado.tif" "/Users/ricardo/Documents/GIS/LaSiembra/DEM Reproyectado-cortado2.tif"
GDAL command output:
ERROR 1: Failed to identify source layer from datasource.
Process returned error code 1
Execution completed in 0.34 seconds
Results:
 OUTPUT: /Users/ricardo/Documents/GIS/LaSiembra/DEM Reproyectado-cortado2.tif

Loading resulting layers
The following layers were not correctly generated.
• /Users/ricardo/Documents/GIS/LaSiembra/DEM Reproyectado-cortado2.tif
You can check the 'Log Messages Panel' in QGIS main window to find more information about the execution of the algorithm.

The process works in the following cases:

  • When using a Shapefile
  • When using a GeoPackage Polygon with no spaces or diacritics (accents) in the layer name
  • When using a GeoPackage Polygon with spaces but no diacritics (accents) in the layer name.

Steps to reproduce the issue

The error can be reproduced as follows:

  1. Load a raster layer in a projected CRS. In my case it's an SRTM tile in EPSG:32619.
  2. Create a GeoPackage Layer of Polygon Geometry type. Name the Table something with accents. In my case, I named it "Área de Interés". Set the CRS as that of the project.
  3. Digitize a polygon over the raster image. Save it.
  4. Go to Raster -> Extraction -> Clip Raster by Mask Layer...
  5. Select the Raster as the Input Layer
  6. Select the Polygon layer as Mask layer
  7. Check the Keep resolution of input raster box
  8. Set the Output Clipped (mask) to a GeoTiff.
  9. Run.
  10. See error

Here's a screencast of the error in my machine:

Bug.Report.GDAL.Warp.fail.accents.mp4

Versions

QGIS version3.40.0-Bratislava
QGIS code revision1d561ad8ad9
 
Libraries
Qt version5.15.2
Python version3.9.5
GDAL/OGR version3.3.2
PROJ version8.1.1
EPSG Registry database versionv10.028 (2021-07-07)
GEOS version3.9.1-CAPI-1.14.2
SQLite version3.35.2
PDAL version2.3.0
PostgreSQL client versionunknown
SpatiaLite version5.0.1
QWT version6.1.6
QScintilla2 version2.11.5
OS versionmacOS 15.1
 
Active Python plugins
QuickOSM2.2.3
profiletool4.2.6
DataPlotly4.2.0
quick_map_services0.19.36
QWater3.3.2
SRTM-Downloader3.2.3
pointsamplingtool0.5.4
processing2.12.99
grassprovider2.12.99
db_manager0.1.20
MetaSearch0.3.6

Supported QGIS version

  • I'm running a supported QGIS version according to the roadmap.

New profile

Additional context

This is running in macOS 15.1.1 (24B91) Sequoia

@hernanrr hernanrr added the Bug Either a bug report, or a bug fix. Let's hope for the latter! label Nov 24, 2024
@agiudiceandrea
Copy link
Contributor

agiudiceandrea commented Nov 25, 2024

@hernanrr, thanks for reporting. I cannot replicate the issue running QGIS on Windows. I guess the issue may be due to the 3 years old version of the GDAL/OGR library used by QGIS installed via the official dmg installer. You can check it verifying if the issue occurs also running the same gdalwarp command in the macOS terminal inside the QGIS installation bin folder.
Some alternative QGIS installation methods for macOS, shipping up-to-date version of the GDAL/OGR library, are:

@agiudiceandrea agiudiceandrea added Feedback Waiting on the submitter for answers macOS labels Nov 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! Feedback Waiting on the submitter for answers macOS
Projects
None yet
Development

No branches or pull requests

2 participants