Skip to content

r.blend: Quote map names in r.mapcalc expressions.#277

Merged
neteler merged 3 commits into
OSGeo:masterfrom
marisn:blend_quote_map
Mar 20, 2020
Merged

r.blend: Quote map names in r.mapcalc expressions.#277
neteler merged 3 commits into
OSGeo:masterfrom
marisn:blend_quote_map

Conversation

@marisn

@marisn marisn commented Jan 10, 2020

Copy link
Copy Markdown
Contributor

Avoids failure if map / mapset name is also a valid mathematical expression.

Avoids failure if map / mapset name is also a valid mathematical expression.
@marisn

marisn commented Jan 13, 2020

Copy link
Copy Markdown
Contributor Author

Same issue also affects r.grow. Fixed with 81761a8

@neteler

neteler commented Feb 15, 2020

Copy link
Copy Markdown
Member

To better try it out, do you have a (simple) example?

@marisn

marisn commented Feb 17, 2020

Copy link
Copy Markdown
Contributor Author

To better try it out, do you have a (simple) example?

Hmmm. This could be a good addition to the test suite, as there could be errors in other modules as well. Still I'm not that familiar with the test suite to understand how to force running all tests in a specific mapset.

  1. In NC basic location create a new mapset '1234-56-78' (a typical mapset naming pattern when I have a single mapset per map sheet) and start GRASS session in it;
  2. g.copy raster=elevation@PERMANENT,elevation
  3. r.blend first=elevation@1234-56-78 second=elevation@1234-56-78 output=blended
  4. Observe output: syntax error, unexpected INTEGER, expecting VARNAME or NAME
  5. r.grow input=elevation@1234-56-78 output=grown
  6. Observe output: syntax error, unexpected INTEGER, expecting VARNAME or NAME

@neteler neteler added this to the 7.8.3 milestone Feb 17, 2020
@neteler

neteler commented Feb 17, 2020

Copy link
Copy Markdown
Member

I have written a testsuite script in PR #347, pls check

neteler added a commit that referenced this pull request Feb 18, 2020
* testsuite: r.blend quoting test

Added test script which implements the test suggested in PR #277

Co-authored-by: Māris Nartišs <mn@sungis.lv>
neteler added a commit that referenced this pull request Feb 18, 2020
* testsuite: r.blend quoting test

Added test script which implements the test suggested in PR #277

Co-authored-by: Māris Nartišs <mn@sungis.lv>
@neteler

neteler commented Feb 26, 2020

Copy link
Copy Markdown
Member

An objections to merge and backport?

@marisn

marisn commented Mar 13, 2020

Copy link
Copy Markdown
Contributor Author

An objections to merge and backport?

No one seems to object. I can rebase, if needed.

@landam

landam commented Mar 20, 2020

Copy link
Copy Markdown
Member

@neteler Are you planning to merge it?

@neteler neteler merged commit 1143002 into OSGeo:master Mar 20, 2020
neteler pushed a commit that referenced this pull request Mar 20, 2020
* r.blend: Quote map names in r.mapcalc expressions.
Avoids failure if map / mapset name is also a valid mathematical expression.

* r.grow: Quote map names in mapcalc expression

* testsuite: r.grow test case for mapcalc map quoting.
Based on PR #347 and PR #277

Co-authored-by: Māris Nartišs <maris.nartiss@lu.lv>
@neteler

neteler commented Mar 20, 2020

Copy link
Copy Markdown
Member

@neteler Are you planning to merge it?

Done and backported

HuidaeCho pushed a commit to HuidaeCho/grass that referenced this pull request Mar 20, 2020
* r.blend: Quote map names in r.mapcalc expressions.
Avoids failure if map / mapset name is also a valid mathematical expression.

* r.grow: Quote map names in mapcalc expression

* testsuite: r.grow test case for mapcalc map quoting.
Based on PR OSGeo#347 and PR OSGeo#277

Co-authored-by: Māris Nartišs <maris.nartiss@lu.lv>
@marisn marisn deleted the blend_quote_map branch April 18, 2020 07:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants