[Qgis-user] Reclassify field values from txt rule file in QGIS

Andrea Giudiceandrea andreaerdna at libero.it
Thu Jun 29 02:27:41 PDT 2023


Hi Fabio,
the "rules" and the "column" option of the GRASS-v.reclass module are 
mutually exclusive. If you set both those options, the module fails to 
execute and it will output the reported error message.

In the QGIS processing algorithm v.reclass there is a bug which prevents 
the user to only specify the "rules" parameter.

So, if you want to use the GRASS v.reclass module through the QGIS 
processing algorithm v.reclass, you need to workaround such bug.

You don't have to use the QGIS Python console (which I haven't advised 
to use).

You need to locate the file named "v.reclass.txt" which is in the path 
\apps\qgis\python\plugins\grassprovider\description\ or 
\apps\qgis-ltr\python\plugins\grassprovider\description\ (depending on 
you are using QGIS or QGIS LTR) inside the QGIS installation folder. 
Then you need to edit such file using a text editor and change the line 
as described before.

This way you can use the QGIS processing algorithm v.reclass specifying 
only the "rules" parameter (and not specifying the "column" parameter) 
and thus avoiding the error.

If you can't or don't want to make such modification of the 
v.reclass.txt file by yourself, then you need to wait for the release of 
the next QGIS 3.28 and 3.32 versions and use one of them, since a fix 
for such bug is pending approval https://github.com/qgis/QGIS/pull/53643 
and it will be hopefully available in QGIS 3.28.9 and 3.32.1 and next 
versions.

Best regards.

Andrea

Il 29/06/2023 10:43, fabio castelli ha scritto:
> Hi Andrea,
> 
> thank you very much for your support. Sorry, I'm new at this.
> I've tried to print the code that you sent me in the Python console but 
> I get errors:


More information about the QGIS-User mailing list