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 have downloaded Globcover data in GeoTIFF format. I want to create a new grid which only has values where the Globcover data (the only band in the TIF file) has one certain value (==190).

Can I do this with GDAL?

If not, which way should I go? The procedure should be callable from a Shell script (Linux). I have QGIS installed (but no clue how to use it).

share|improve this question
    
The question is Gdal specific, the answer is Qgis specific. Then, could we rename the question ? –  Hugolpz Aug 19 '13 at 12:21
add comment

1 Answer

up vote 4 down vote accepted

In QGIS you have the raster calculator (Under the "Raster" menu) which will do what you want. (not a shell script command)

  • Load your Globcover raster into QGIS, and open the Raster Calculator.
  • The raster will appear in the "Bands" window.
  • Enter a name for the new "Output Layer".
  • Now double click on the Globcover band name so that it appears in the lower "Raster calculator expression".
  • Then complete the expression by typing "=190" in that window.
  • Click OK to create the new raster.

Note that you will have a raster with values of either 190 or 0 everywhere else. You can further use gdal_translate to set the zeros to NULL.

HTH, Micha

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.