1

I am trying to reclassify a DEM by using the new Reclassify by layer tool in QGIS3. I am using the following input table:

enter image description here

However, as shown in below screenshot of the tool, the Minimum class value field and Maximum class value field don't show any values.

enter image description here

What could I have done wrong here?

1

Reclassify by layer is expecting you to use another vector layer's attributes rather than just a table. It works in this situation.

I don't know whether this is a bug, an oversight or deliberate, because you can indeed add a delimited text table to the TOC with no geometry but this tool only considers actual vector layers (with geometry... which is redundant for the function... and therefore I'd have thought it would be easy for the developers to allow the use of simple tables*). This is the source of the confusion here!

For your use-case you need Reclassify by table or r.reclass from GRASS. The first of these will require you to input the values into a blank table provided (similar to ArcGIS's dialog) but the latter will allow the use of a rules file.

*This is maybe a cause for raising a feature request or bug report

  • Thanks for the explanation about needing a vector atrributes rather than a delimited text table. I know I could do it with reclassify by table or r.reclass for a few files. The problem is that I would like to automate the process since I have a couple of hundred of files. – henkth Feb 13 at 10:27
  • I noticed your other post on that after writing this - have a look there for a suggestion. – MappaGnosis Feb 13 at 11:04
0

I think Reclassify by layer will not work if you just provide a table as a class break. The tool requires a vector layer, and based on vector layer you can choose the minimum and maximum values.

By Providing just a table such CSV file, the minimum and maximum fields are not activated:

enter image description here

But if you provide vector layer, they will be activated:

enter image description here

So the idea is to classify a raster data based on a vector layer which enables you to select minimum an maximum fields from the attribute table.

If you want to use a table and you define the values by yourself as a break values, you need to use Reclassify by table tool:

enter image description here

If you have many rasters, you can use Execute as Batch Process although it will be tough work if you have hundreds of raster data.

enter image description here

  • Thanks for the explanation about needing a vector layer to make a table input work. Your solution using Reclassify by table requires manual inputting and that's ok for a few files. The problem is that I would like to automate the process since I have a couple of hundred of files. – henkth Feb 13 at 10:23
  • 1
    Right click the tool and use execute by batch and I know this may not also solve the issue. But I do not expect someone will offer you a script without writing your own script. – ahmadhanb Feb 13 at 10:38
0

May I refer to my other post related to this where I found a solution for my problem: QGIS: r.reclass rules based on table values I would like to thank everyone that tried to help with this and the other post!

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.