Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I would like to clip a DEM with an admin boundary using qgis, in order to calculate a measure of variation. However, when I use the Raster clipper tools and select mask, I get the error message: "An error has occured while executing Python code: ...".

It seems this has been noticed by others: see http://osgeo-org.1803224.n2.nabble.com/Re-qgis2google-and-clipper-plugins-td6604408.html

Does this imply that the tool is unavailable for use with Wroclaw 1.7.3?

All I am looking for is a measure of variation based on an admin boundary, and was planning to use the ruggedness index.

Is there a fix for the clipper tool I am unaware of, or any other simple way to calculate a measure of topological variation? It doesn't have to be ruggedness.

Thanks!

share|improve this question
    
what version of gdal tools (see in the "raster" menu) are you using? –  Giovanni Manghi Jan 18 '12 at 15:19
    
Giovanni, I am using GDAL v. 1.8.1 –  kirk Jan 19 '12 at 12:40
add comment

2 Answers 2

It's due to a python bug, fixed in python v2.5.3 and v2.6.1. Here's the ticket on QGis trac about that issue.

You can upgrade python (OSGeo4W is moving to python2.7) or remove the affected line (and also few lines below it) or even... use Linux.

share|improve this answer
    
Giuseppe, I installed 2.7.2 for OSX 1.7, but the clipper is still not working for me. Do I need to update any pathways or anything? –  kirk Jan 19 '12 at 12:41
    
@user5533 I think QGis is still using the old python. Please, run Qgis and from menu Plugins click on Python Console. In the console execute import sys; sys.version and report here. –  Giuseppe Sucameli Jan 21 '12 at 20:03
    
'2.7.1 (r271:86832, Jun 16 2011, 16:59:05) \n[GCC 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2335.15.00)]' –  kirk Jan 22 '12 at 20:37
add comment

Not a direct answer to your question, but a possible workaround: You could convert your vector mask to a raster, and do your processing using all raster data.

I would also suggest trying to run the command directly in GDAL rather than via QGIS. Sometimes I've had luck doing that!

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.