[GIS] Qgis problem clipping a raster .asc file, the output is unreadable

qgisraster

I am currently using QGIS (1.8.0) to prepare files for use in MaxEnt to predict species distribution in a new territory in Argentina. I need to

a) cut the raster files (bioclim, and others) to a single province, and

b) create a .asc file from a .shp file (not sure if this is possible in QGIS)

My problem is with point 'a'. I have read the various questions on this site regarding raster clipping which were very useful. I have set the CRS for each file (WGS84 EPSG4326), and the Raster/Extractions/Clipper tool using a mask does create a file.

However, when I open this file using TextPad (with which I can view the original larger file) the text is in an unknown language/script and does not open in MaxEnt.

I was worried the problem my lay in the fact that my .shp mask did not fully fall within my original raster, so I tried clipping by extent, so I clipped only within the extent of the raster, but got the same results.
Has anyone any suggestions as to what might be the problem?

Best Answer

Clipping of raster files only works when the raster file has the same CRS as the vector file. The clipping is not done within Qgis, but with gdal. So it is not helful to set the CRS within Qgis, but you have to transform your asc file to a geotiff file, which has the CRS information stored within the file.

So first step is Raster -> Projections -> Warp, set the desired CRS and save as Geotiff, then do the clipping on the Geotiff file.

If you can not handle Geotiff files with your application, you can reconvert the file again after clipping with Raster -> Convert -> Translate.