Bug report #4191

Raster clipper does not work with a shp mask

Added by Paolo Cavallini about 8 years ago. Updated almost 8 years ago.

Status:Closed
Priority:Normal
Assignee:Giuseppe Sucameli
Category:GDAL Tools
Affected QGIS version: Regression?:No
Operating System: Easy fix?:No
Pull Request or Patch supplied:No Resolution:invalid
Crashes QGIS or corrupts data: Copied to github as #:14166

Description

gdalwarp -q -cutline /home/paolo/pisa.shp -crop_to_cutline -of GTiff /home/paolo/hdr.adf /home/paolo/dtm_pisa.tif

results in

Cannot compute bounding box of cutline.

History

#1 Updated by Giuseppe Sucameli about 8 years ago

Unable to reproduce it here.

Anyway the message is a GDAL (error???) message, not a GdalTools plugin one.
Could you try to run the same command from a terminal?

#2 Updated by Caio Hamamura about 8 years ago

Yeah, it is GdalTools plugin issue. Running from terminal does work.

#3 Updated by Giuseppe Sucameli about 8 years ago

Caio Hamamura wrote:

Yeah, it is GdalTools plugin issue. Running from terminal does work.

Sorry, but I'm not sure I understood.
Did you run it both from GdalTools plugin and from terminal? If so, could you write here the command you ran?
Otherwise, can you try to run the same command from both them and then write here the results/errors?

#4 Updated by Andrea Borruso almost 8 years ago

Hi Giuseppe,
I have just tested it in QGIS 1.7.1-Wroclaw Wroclaw, e6718b6 (bundled with GDAL/OGR 1.8.1) installed on Windows XP pro sp3.

If I run clip from terminal (starting from "C:\\OSGeo4W\\bin" folder), I have no error. My command is: gdalwarp -cutline poly.shp tif.tif tif_cut.tif

If I use it in Gdal Tools for QGIS I have this error:

Errore durante l'esecuzione di codice Python:

Traceback (most recent call last):
  File "C:/OSGeo4W/apps/qgis/./python/plugins\\GdalTools\\tools\\widgetPluginBase.py", line 27, in someValueChanged
    self.emit(SIGNAL("valuesChanged(const QStringList &)"), self.getArguments())
  File "C:/OSGeo4W/apps/qgis/./python/plugins\\GdalTools\\tools\\doClipper.py", line 105, in getArguments
    return self.getArgsModeMask()
  File "C:/OSGeo4W/apps/qgis/./python/plugins\\GdalTools\\tools\\doClipper.py", line 143, in getArgsModeMask
    if self.alphaBandCheck.isChecked():
TypeError: 'sip.methoddescriptor' object is not callable

Versione Python:
2.5.2 (r252:60911, Feb 21 2008, 13:11:45) [MSC v.1310 32 bit (Intel)]

Versione di QGIS:
1.7.1-Wroclaw Wroclaw, e6718b6

Percorso Python: ['C:\\\\Documents and Settings\\\\aborruso\\\\.qgis\\\\python\\\\plugins\\\\GeoCoding', 'C:\\\\Documents and Settings\\\\aborruso\\\\.qgis\\\\python\\\\plugins\\\\GeoCoding', 'C:\\\\Documents and Settings\\\\aborruso\\\\.qgis\\\\python\\\\plugins\\\\GeoCoding', 'C:/OSGeo4W/apps/qgis/./python', 'C:/Documents and Settings/aborruso/.qgis/python', 'C:/Documents and Settings/aborruso/.qgis/python/plugins', 'C:/OSGeo4W/apps/qgis/./python/plugins', 'C:\\\\OSGeo4W\\\\bin\\\\python25.zip', 'C:\\\\OSGeo4W\\\\apps\\\\Python25\\\\DLLs', 'C:\\\\OSGeo4W\\\\apps\\\\Python25\\\\lib', 'C:\\\\OSGeo4W\\\\apps\\\\Python25\\\\lib\\\\plat-win', 'C:\\\\OSGeo4W\\\\apps\\\\Python25\\\\lib\\\\lib-tk', 'C:\\\\OSGeo4W\\\\apps\\\\qgis\\\\bin', 'C:\\\\OSGeo4W\\\\apps\\\\Python25', 'C:\\\\OSGeo4W\\\\apps\\\\Python25\\\\lib\\\\site-packages', 'C:\\\\OSGeo4W\\\\apps\\\\Python25\\\\lib\\\\site-packages\\\\win32', 'C:\\\\OSGeo4W\\\\apps\\\\Python25\\\\lib\\\\site-packages\\\\win32\\\\lib', 'C:\\\\OSGeo4W\\\\apps\\\\Python25\\\\lib\\\\site-packages\\\\Pythonwin', 'C:\\\\OSGeo4W\\\\apps\\\\Python25\\\\lib\\\\site-packages\\\\wx-2.8-msw-unicode', 'C:\\\\Documents and Settings\\\\aborruso\\\\.qgis\\\\python\\\\plugins\\\\openlayersov\\\\logic', 'C:\\\\Documents and Settings\\\\aborruso\\\\.qgis\\\\python\\\\plugins\\\\openlayersov\\\\gui', 'C:\\\\OSGeo4W\\\\apps\\\\qgis\\\\python\\\\plugins\\\\fTools\\\\tools']

I have this error immediately after selecting the vector I want use to clip.

Best regards

#5 Updated by Giovanni Manghi almost 8 years ago

  • Target version set to Version 1.7.4

#6 Updated by Giuseppe Sucameli almost 8 years ago

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

Andrea Borruso wrote:

I have just tested it in QGIS 1.7.1-Wroclaw Wroclaw, e6718b6 (bundled with GDAL/OGR 1.8.1) installed on Windows XP pro sp3.
If I use it in Gdal Tools for QGIS I have this error:
[...]
I have this error immediately after selecting the vector I want use to clip.

Andrea, the python error you reported was fixed, I'm sure you already know it :)

Instead the original error reported by pcav is neither a GdalTools error or a GDAL one (even if the error message is a GDAL message). Probably the cutline extent doesn't intersect the input raster extent.

I'm closing this ticket.

Also available in: Atom PDF