3

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

6
  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

1
  • Thank you all so much! Will try every suggestion! Jan 15 at 18:00
5

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

5
  • Thanks, I thought it goes something like that, but when I try to create vector grid with points, I need to choose grid extent, and it offers me this options: draw on canvas, use map canvas extent and calculate from layer And I dont know how to continue, which one to use or how to use it Jan 15 at 17:15
  • 2
    Choose to use the extent of the grid layer
    – BERA
    Jan 15 at 17:23
  • How to do that? I dont quite understand Jan 15 at 17:35
  • You could draw the extent on the canvas and then edit the grid if it is too big to make it 3*3 :).
    – wanderzen
    Jan 15 at 17:58
  • **draw on canvas (sorry)
    – wanderzen
    Jan 15 at 18:08

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.