2

I want to create raster structure with 3 columns and 3 rows (3x3). The raster resolution should be 10 m, and cell values should be set according to the attached picture. After that, I plan to reclassify it by replacing values greater than or equal to 140 with number 20, and all values that are less than 140 with number 10.

Any ideas how to accomplish that?

This is the picture with values

enter image description here

2 Answers 2

8
  1. Open a text editor.

  2. Type the followings and save as test.asc:

    ncols 3
    nrows 3
    xllcorner 0
    yllcorner 0
    cellsize 10
    nodata_value -32768
    142 139 138
    140 137 135
    136 135 130
    

    If you know yllcorner/xllcorner, change 0s. (ll: lower left)

In QGIS

  1. Open an empty project. Select a metric CRS for the project from "Project - Properties... - CRS tab".

  2. Go to "Layer Menu - Add Layer - Add Raster Layer...".

  3. Specify file path and data type as in the image.

    enter image description here

enter image description here

0
4

I don't have my laptop with me so I may not use the exact Qgis tools terms but you shall do something like this:

  1. create a 3*3 grid with the desired resolution (in your case 10 meters)
  2. create a field "value" where you can assign your values to each cell
  3. rasterize your grid by using the value field as the "burn in value"
  4. use the raster calculator to change your pixel values:

("raster@1" < 140) * 10+ ("raster@1" >= 140)* 20

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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