I want to use the 'change grid vaues' tool to go through a number of grids while using a txt as a look-up table.
And after trying around for a bit I just can't find a proper way to do it.
This is one of the different attempts.
Not sure if this is the only problem, but the input grid has already been added to the Data Manager, so setting it should be changed to:
Tool.Set_Parameter('INPUT', grid)
Having a look at the tool, I see that the table parameter is a static table. This might need additional tweaks to get it working, but please try this change first.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Yes, the grid input was a problem and the tool seems to execute now. Thank you.
But I think there must be something wrong with the table still because the 'OUTPUT' grid remains unchanged even though the values in the table correspond with the grid values.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Here, we must use the static table which is created by the tool itself and assign it the values from the table you loaded. Please also have in mind that your table must have the same attribute field structure as table that is used by the tool (have a look in saga_gui if your are unsure).
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello all,
I want to use the 'change grid vaues' tool to go through a number of grids while using a txt as a look-up table.
And after trying around for a bit I just can't find a proper way to do it.
This is one of the different attempts.
I also tried this:
I would be glad to find out how this properly works
Thanks
Fred
Hi Fred,
in order to use a dataset with a tool you have to add it to the Data Manager first. So in your case you should load the table like this:
Then you can set the table parameter of the tool like this:
After the table is not needed any more you should free the memory by removing it from the Data Manager:
Best regards,
Volker
Hey Volker,
thanks for the reply.
Unfortunately, now I get the message:
This is the entire code that is supposed to run and obviously I'm missing something.
best regards
Fred
Not sure if this is the only problem, but the input grid has already been added to the Data Manager, so setting it should be changed to:
Having a look at the tool, I see that the table parameter is a static table. This might need additional tweaks to get it working, but please try this change first.
Yes, the grid input was a problem and the tool seems to execute now. Thank you.
But I think there must be something wrong with the table still because the 'OUTPUT' grid remains unchanged even though the values in the table correspond with the grid values.
Yes, as I suspected the static table parameter needs a special treatment. You already had the right idea, this should work:
Here, we must use the static table which is created by the tool itself and assign it the values from the table you loaded. Please also have in mind that your table must have the same attribute field structure as table that is used by the tool (have a look in saga_gui if your are unsure).
This was the problem!
Thank you very much.
Have a nice day
Fred