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-based algorithms should pass not only file path but also layer name #30292
Comments
@rjhale1971 is the geopackage a MULTIpolygon? is yes that is not accepted by gdalwarp, not a QGIS issue (I think that is the source of the error message). |
You are correct - It is a Multipolygon! I didn't know those weren't acceptable....and actually I hadn't looked at the polygon type. This can be closed then. |
Actually.........I'm still getting an error. I went back and double checked with a polygon (non-multi) and I still get the same error. Let me paste the new error message: GDAL command: No where in the error message is my cut layer mentioned. It appears to be getting left out. Let me test this by copying an d pasting that command outside of QGIS. |
can you attach it? @rjhale1971 |
I have attached the geopackage with a multipolygon, polygon, and a raster. After trying it one more time tonight it seems to be working. So I think I will stop for now. Sorry for the wrong report. I must have been doing something wrong. |
@rjhale1971 there is definitely a bug. With the attached datasurce, a multi layer datasource, the GDAL command that is created by Processing is like:
but has there are >1 vector layers in the source it should be
where "park" is one of the vector layers in the datasoource. The second "production.gpkg" represent the input raster layer, and in this case is ok because there is only 1 inside the GPKG, but there could be more, in this case I'm not sure what the parameter to be used on the command line... it must be checked too if Processing does the right thing or not also in this case. |
Ahhh. OK. I personally broke a bug reporting rule by changing my process and I couldn't recreate it - which is why I kept backing off thinking I had a false bug. |
[processing] pass layer name to the gdalwarp to avoid issues with multi-layer datasources (fix #30292)
I'm testing QGIS Master 64015a8 on Ubuntu 19.04
Add a Image to QGIS
Add a Polygon Layer from a Geopackage to QGIS covering a portion of the Raster.
Run the Clip Raster By Mask Layer Processing Tool
Process Fails with:
GDAL command:
gdalwarp -s_srs EPSG:2234 -t_srs EPSG:2234 -of GTiff -cutline /media/data/projects/planetzero/data/production.gpkg -crop_to_cutline /media/data/projects/planetzero/data/imagery/mosaic_2234.tif /home/rjhale/temp/randy.tif
GDAL command output:
ERROR 1: Cutline not of polygon type
Replace the Polygon from a Geopackage with a Shapefile and it runs correctly.
I've checked the polygon layer and set "do not filter" for invalid features just in case. That didn't help or hurt.
I wasn't sure about attaching files since image + geopackage will be about 25MB. I can though if I need to.
The text was updated successfully, but these errors were encountered: