No output from GRASS 7 r.reclass in Processing Python scriptNo output generated with “r.drain” GRASS...
Multi tool use
Promise.all returning empty objects
Taking an academic pseudonym?
How do I fight with Heavy Armor as a Wizard with Tenser's Transformation?
Was there a pre-determined arrangement for the division of Germany in case it surrendered before any Soviet forces entered its territory?
In the Lost in Space intro why was Dr. Smith actor listed as a special guest star?
Identical projects by students at two different colleges: still plagiarism?
Was Opportunity's last message to Earth "My battery is low and it's getting dark"?
What does an unprocessed RAW file look like?
How would an EMP effect spacesuits (and small-arms weapons)?
Is layered encryption more secure than long passwords?
Sticky Strike or Sticky Delta
What's the reason that we have a different number of days each month?
Trying to detect if any checked values contains a specific string
How can I differentiate duration vs starting time
What would be some possible ways of escaping higher gravity planets?
Renting a 2CV in France
Why do objects rebound after hitting the ground?
"I showed the monkey himself in the mirror". Why is this sentence grammatical?
How to draw a node with two options using TikZ graphs in LaTeX
How do I avoid the "chosen hero" feeling?
Why is it that Bernie Sanders is always called a "socialist"?
Is there a way to pause a running process on Linux systems and resume later?
Crack the bank account's password!
Dealing with an internal ScriptKiddie
No output from GRASS 7 r.reclass in Processing Python script
No output generated with “r.drain” GRASS moduler.viewshed Raster map not foundspurious “.tif Exists” errors on QGIS Python script processingPyQGIS GRASS r.reclass from Processing without resultAlgorithm r.reclass in QGIS gives same results with different reclass rulesQGIS Processing input list of numbers?QGIS 3 r.texture no outputQGIS - Struggling with r.reclass, North must be larger than south, etc - error log in postDEM File “not found” Error when running r.watershed with Processing Toolbox in QGIS 3.4.2 with GRASSUnable to load output layer from Python algorithm in QGIS 3
I want to run the r.reclass tool in python on a raster layer to reclassify 1 value (and leave the rest the way they are).
Here is my best attempt so far, after trying to reference documentation and other examples. Here is my code:
import processing
input_raster = QgsRasterLayer('/Users/ep9k/Desktop/Key-LogEcovaluator/Rasters/AestheticMax.tif', 'raster')
output_raster = '/Users/ep9k/Desktop/OutputReclass.tif'
rules_file = '/Users/ep9k/Desktop/reclassrules.txt'
parameters = {'Input' : input_raster,
'rules' : rules_file,
'Output' : output_raster,
'GRASS_REGION_PARAMETER' : '1277290, 1314314, -14004, 11845', #this is the exent of my raster layer
'GRASS_REGION_CELLSIZE_PARAMETER' : 0
}
processing.runAndLoadResults('grass7:r.reclass', parameters)
I run the script and I don't get any errors, but nothing happens. No output, nothing is reclassified. I think I am missing something obvious here.
I get the help docs by running the following in the console:
processing.algorithmHelp("grass7:r.reclass")
I am confused by 2 of the input parameters. Specifically GRASS_RASTER_FORMAT_OPT and GRASS_RASTER_FORMAT_META. Are these required?
qgis pyqgis grass qgis-3 qgis-processing
add a comment |
I want to run the r.reclass tool in python on a raster layer to reclassify 1 value (and leave the rest the way they are).
Here is my best attempt so far, after trying to reference documentation and other examples. Here is my code:
import processing
input_raster = QgsRasterLayer('/Users/ep9k/Desktop/Key-LogEcovaluator/Rasters/AestheticMax.tif', 'raster')
output_raster = '/Users/ep9k/Desktop/OutputReclass.tif'
rules_file = '/Users/ep9k/Desktop/reclassrules.txt'
parameters = {'Input' : input_raster,
'rules' : rules_file,
'Output' : output_raster,
'GRASS_REGION_PARAMETER' : '1277290, 1314314, -14004, 11845', #this is the exent of my raster layer
'GRASS_REGION_CELLSIZE_PARAMETER' : 0
}
processing.runAndLoadResults('grass7:r.reclass', parameters)
I run the script and I don't get any errors, but nothing happens. No output, nothing is reclassified. I think I am missing something obvious here.
I get the help docs by running the following in the console:
processing.algorithmHelp("grass7:r.reclass")
I am confused by 2 of the input parameters. Specifically GRASS_RASTER_FORMAT_OPT and GRASS_RASTER_FORMAT_META. Are these required?
qgis pyqgis grass qgis-3 qgis-processing
1
It looks like you're using the older 2.x API under QGIS 3?
– ndawson
yesterday
add a comment |
I want to run the r.reclass tool in python on a raster layer to reclassify 1 value (and leave the rest the way they are).
Here is my best attempt so far, after trying to reference documentation and other examples. Here is my code:
import processing
input_raster = QgsRasterLayer('/Users/ep9k/Desktop/Key-LogEcovaluator/Rasters/AestheticMax.tif', 'raster')
output_raster = '/Users/ep9k/Desktop/OutputReclass.tif'
rules_file = '/Users/ep9k/Desktop/reclassrules.txt'
parameters = {'Input' : input_raster,
'rules' : rules_file,
'Output' : output_raster,
'GRASS_REGION_PARAMETER' : '1277290, 1314314, -14004, 11845', #this is the exent of my raster layer
'GRASS_REGION_CELLSIZE_PARAMETER' : 0
}
processing.runAndLoadResults('grass7:r.reclass', parameters)
I run the script and I don't get any errors, but nothing happens. No output, nothing is reclassified. I think I am missing something obvious here.
I get the help docs by running the following in the console:
processing.algorithmHelp("grass7:r.reclass")
I am confused by 2 of the input parameters. Specifically GRASS_RASTER_FORMAT_OPT and GRASS_RASTER_FORMAT_META. Are these required?
qgis pyqgis grass qgis-3 qgis-processing
I want to run the r.reclass tool in python on a raster layer to reclassify 1 value (and leave the rest the way they are).
Here is my best attempt so far, after trying to reference documentation and other examples. Here is my code:
import processing
input_raster = QgsRasterLayer('/Users/ep9k/Desktop/Key-LogEcovaluator/Rasters/AestheticMax.tif', 'raster')
output_raster = '/Users/ep9k/Desktop/OutputReclass.tif'
rules_file = '/Users/ep9k/Desktop/reclassrules.txt'
parameters = {'Input' : input_raster,
'rules' : rules_file,
'Output' : output_raster,
'GRASS_REGION_PARAMETER' : '1277290, 1314314, -14004, 11845', #this is the exent of my raster layer
'GRASS_REGION_CELLSIZE_PARAMETER' : 0
}
processing.runAndLoadResults('grass7:r.reclass', parameters)
I run the script and I don't get any errors, but nothing happens. No output, nothing is reclassified. I think I am missing something obvious here.
I get the help docs by running the following in the console:
processing.algorithmHelp("grass7:r.reclass")
I am confused by 2 of the input parameters. Specifically GRASS_RASTER_FORMAT_OPT and GRASS_RASTER_FORMAT_META. Are these required?
qgis pyqgis grass qgis-3 qgis-processing
qgis pyqgis grass qgis-3 qgis-processing
edited 4 mins ago
underdark♦
68.3k13177342
68.3k13177342
asked 2 days ago
Erich PurpurErich Purpur
314114
314114
1
It looks like you're using the older 2.x API under QGIS 3?
– ndawson
yesterday
add a comment |
1
It looks like you're using the older 2.x API under QGIS 3?
– ndawson
yesterday
1
1
It looks like you're using the older 2.x API under QGIS 3?
– ndawson
yesterday
It looks like you're using the older 2.x API under QGIS 3?
– ndawson
yesterday
add a comment |
0
active
oldest
votes
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "79"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fgis.stackexchange.com%2fquestions%2f313250%2fno-output-from-grass-7-r-reclass-in-processing-python-script%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Geographic Information Systems Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fgis.stackexchange.com%2fquestions%2f313250%2fno-output-from-grass-7-r-reclass-in-processing-python-script%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
0 F,iLjkel901q
1
It looks like you're using the older 2.x API under QGIS 3?
– ndawson
yesterday