Bug report #14868

pyqgis gdalogr:merge output set as shapefile

Added by paolo prosperi over 8 years ago. Updated over 8 years ago.

Status:Closed
Priority:High
Assignee:-
Category:Processing/GDAL
Affected QGIS version:2.14.2 Regression?:No
Operating System:windows Easy fix?:No
Pull Request or Patch supplied:No Resolution:invalid
Crashes QGIS or corrupts data:No Copied to github as #:22821

Description

As far as I can see, on QGis Essen (2.14.2) python console and toolbox, gdalogr:merge fails to merge any number of rasters as the ouput file type is set to shapefile instead of raster. No problem in using raster/miscellaneous/merge from the GUI.

My log from toolbox:

Algorithm Merge starting...
GDAL command:
cmd.exe /C gdal_merge.bat -ot Float32 -o C:\\Users\\PP\\AppData\\Local\\Temp\\processingbab017b1f8ad4d5fbd1e71a5c507f5d2\\1c10240463254b64a6f7569a4ce0d2e5\\OUTPUT.shp -of "ESRI Shapefile" E:\\Idaho-code\\gfed4_sinusoidal.tif
GDAL command output:
ERROR 6: C:\\Users\\PP\\AppData\\Local\\Temp\\processingbab017b1f8ad4d5fbd1e71a5c507f5d2\\1c10240463254b64a6f7569a4ce0d2e5\\OUTPUT.shp: SetGeoTransform() not supported for this dataset.
ERROR 6: C:\\Users\\PP\\AppData\\Local\\Temp\\processingbab017b1f8ad4d5fbd1e71a5c507f5d2\\1c10240463254b64a6f7569a4ce0d2e5\\OUTPUT.shp: Dataset does not support the SetProjection() method.
0...10...20...30...40...50...60...70...80...90...100 - done.
Converting outputs
Loading resulting layers

The following layers were not correctly generated.
Merged
You can check the log messages to find more information about the execution of the algorithm

sample1.tif (1.3 MB) paolo prosperi, 2016-05-23 05:44 AM

sample2.tif (1.3 MB) paolo prosperi, 2016-05-23 05:44 AM

History

#1 Updated by Alexander Bruy over 8 years ago

Can you provide sample data? It works for me fine under Linux and Windows

#2 Updated by Giovanni Manghi over 8 years ago

  • Category changed from Python plugins to Processing/GDAL
  • Status changed from Open to Feedback

Alexander Bruy wrote:

Can you provide sample data? It works for me fine under Linux and Windows

Hi Alex,
I'm also not able to replicate this issue, but there seems to be a pattern as it was also reported elsewhere.

See for instance the log attached here #14665 the issue is the same, it is set as output format SHP where it should be a TIF.

#3 Updated by Alexander Bruy over 8 years ago

I saw this log and tested attached model. Can't reproduce this

#4 Updated by paolo prosperi over 8 years ago

Please find attached two sample datasets to merge.

When GDAL Merge is run from toolbox, merge fails with the following log (identical to the one already reported), no matter the rasters I pick:

Algorithm Merge starting...
GDAL command:
cmd.exe /C gdal_merge.bat -ot Float32 -o C:\\Users\\PP\\AppData\\Local\\Temp\\processing68e43ea7419f40c985644e8ae4929a02\\e886d719563d4c81b15aca82f1b49793\\OUTPUT.shp -of "ESRI Shapefile" E:\\sample2.tif E:\\sample1.tif
GDAL command output:
ERROR 6: C:\\Users\\PP\\AppData\\Local\\Temp\\processing68e43ea7419f40c985644e8ae4929a02\\e886d719563d4c81b15aca82f1b49793\\OUTPUT.shp: SetGeoTransform() not supported for this dataset.
ERROR 6: C:\\Users\\PP\\AppData\\Local\\Temp\\processing68e43ea7419f40c985644e8ae4929a02\\e886d719563d4c81b15aca82f1b49793\\OUTPUT.shp: Dataset does not support the SetProjection() method.
0...10...20...30...40...50...60...70...80...90...100 - done.
Converting outputs
Loading resulting layers

The following layers were not correctly generated.
Merged
You can check the log messages to find more information about the execution of the algorithm

#5 Updated by Giovanni Manghi over 8 years ago

paolo prosperi wrote:

Please find attached two sample datasets to merge.

When GDAL Merge is run from toolbox, merge fails with the following log (identical to the one already reported), no matter the rasters I pick:

still cannot replicate on both linux and windows with qgis 2.14.3 and master.

what version of Processing does show in the plugin manager? have you tries with a clean installation (try remove temporarily the .qgis2 folder)?

#6 Updated by paolo prosperi over 8 years ago

Ok, merge is back to normal now.
I simply deleted the .qgis2 folder, but I have no clue of the causes of that problem.

Thank you Giovanni

#7 Updated by Giovanni Manghi over 8 years ago

  • Resolution set to invalid
  • Status changed from Feedback to Closed

paolo prosperi wrote:

Ok, merge is back to normal now.
I simply deleted the .qgis2 folder, but I have no clue of the causes of that problem.

probably a obsolete version of Processing in .qgis2 masking the one shipped with the latest qgis releases.

Also available in: Atom PDF