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?

  • I am having the same problem with QGIS 2.0. If I try to clip and save as asc file the output is unreadable. – user23384 Oct 28 '13 at 15:44
  • not an answer but having the same problem. Was this ever remedied? – user35883 Aug 15 '14 at 22:46
  • This does not really answer the question. If you have a different question, you can ask it by clicking Ask Question. You can also add a bounty to draw more attention to this question once you have enough reputation. – PolyGeo Aug 15 '14 at 23:22

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.

  • I did try this step also, as I read it in an earlier post, but after Raster -> Projections -> Warp to set the desired CRS saved as a Geotiff file the output still is unreadable. However, in clipping I saved the output file as a .asc! Possibly this is my problem. Should I save the output from Raster -> Extraction -> Clipping as as Geotiff? – emma256 Oct 24 '12 at 14:27
  • Yes, do the clipping with Geotiff file, and reconvert in a next step. You can add the Clipped Geotiff to the Qgis canvas to check if the clipping was correct. – AndreJ Oct 24 '12 at 15:05
  • I have tried saving the clipping output as a Geotiff, but had the same result. The file does up load onto to the canvas, and is the correct size, but the file itself is unreadable when opened in Textpad, and does not open in MaxEnt! – emma256 Oct 25 '12 at 19:32
  • 1
    As I wrote above, you have to reconvert the resulting file back to asc format, if your application can only read that format. – AndreJ Oct 26 '12 at 4:05
  • yes, sorry I wasn't clear, I did do this. – emma256 Oct 26 '12 at 13:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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