Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ERROR: r.distance: Sorry, <output> is not a valid parameter[Bug] #643

Closed
julychee opened this issue May 17, 2020 · 5 comments
Closed

ERROR: r.distance: Sorry, <output> is not a valid parameter[Bug] #643

julychee opened this issue May 17, 2020 · 5 comments
Labels
bug Something isn't working

Comments

@julychee
Copy link

Hello!

For an assignment I am using QGIS (on macOS 10.14.6 with Grass 7 version 2.0) and I am wanting to use r.distance to calculate the distance between points and an area (which i'm assuming works but i'm not even sure because I can't run r.distance). Once I input my parameters and run the tool, it gives me the following error written in red: ERROR: r.distance: "Sorry, is not a valid parameter". In the log file I can also see another error after it executes the folder in which r.distance is, saying "NameError: name 'file' is not defined". In addition, the log says that there is an output as a txt file, but it is not created.
Screen Shot 2020-05-17 at 10 37 48 PM
Screen Shot 2020-05-17 at 10 38 03 PM

Steps:

  1. open r.distance
  2. select my two raster layers, leave the field separator as is, and choose my output as distance as "desc".
  3. run r.distance
  4. see error

I will add screenshots of the log as a resulting of running r.distance.
My question is, what does that error message mean? Is it something I can fix?If not, is there another tool I can use that serves the same purpose?

Thank you!

@julychee julychee added the bug Something isn't working label May 17, 2020
@neteler
Copy link
Member

neteler commented May 17, 2020

To me it looks like a wrong definition in the respective QGIS control file:
https://github.com/qgis/QGIS/blob/2338b1491c2762eac7ed0693fb11e1057695ff27/python/plugins/processing/algs/grass7/description/r.distance.txt#L10

since r.distance does not have an output parameter, see:
https://grass.osgeo.org/grass78/manuals/r.distance.html

(unless there is an extra trick in the QGIS processing interface to deal with such text outputs sent to the standard output like in this case...)

@nilason
Copy link
Contributor

nilason commented May 18, 2020

This is a QGIS issue.

(unless there is an extra trick in the QGIS processing interface to deal with such text outputs sent to the standard output like in this case...)

Yes, the standard output is supposed to be redirected to a text file as declared in r.distance.txt:

QgsProcessingParameterFileDestination|output|Distance|Txt files (*.txt)|None|False

I'm not sure how that is intended to work, but as a workaround, changing that line to:

QgsProcessingParameterFileDestination|html|Distance|Html files (*.html)|distance.html|False

the command works (output will be in html format though).

@julychee that file is probably located here:

/Applications/QGIS3.10.app/Contents/Resources/python/plugins/processing/algs/grass7/description/r.distance.txt

@nilason
Copy link
Contributor

nilason commented May 18, 2020

Reported the issue with QGIS.

@julychee
Copy link
Author

Thank you!

When changing the command mentioned above by @nilason, the output is now created as an html. However, I am now getting a different error, which leads the html output to be empty:

ERROR: Raster map <rast_5ec28a490abe839> is not CELL

I am not sure I understand what this means. I didn't have this error before.
Screen Shot 2020-05-18 at 3 19 39 PM

@nilason
Copy link
Contributor

nilason commented May 24, 2020

This issue has been closed downstream qgis/QGIS#36520 with fix qgis/QGIS#36644, which was also backported to QGIS 3.10. This issue may be closed.

@julychee Thanks for your report! I don't know what caused your second issue. Please take a look at manual of r.distance, maybe that can give a clue. If not, consider file a new report at https://github.com/qgis/QGIS/.

@neteler neteler closed this as completed May 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants