[GRASS-user] r.shaded.relief-spgrass6 problems

Hello List,
I am having trouble parsing the r.shaded.relief module from R using the
spgrass6 package.
When doing it directly in GRASS, it works but an error is first returned. It
goes as follows:

r.shaded.relief map=alt shadedmap=elev.shad_relief altitude=80 --overwrite
basename: extra operand
`(x86)/GRASS-65-SVN/scripts/r.shaded.relief'
Try `basename --help' for more information.
basename: extra operand
`(x86)/GRASS-65-SVN/scripts/r.shaded.relief'
Try `basename --help' for more information.
Calculating shading, please stand by.
Color table for raster map <elev.shad_relief> set to 'grey'
Shaded relief map created and named <elev.shad_relief>.

This looks the same in R but this causes R to cease computation. The above
command sent with R yields:

execGRASS("r.shaded.relief",flags="overwrite", parameters=list(map="alt",
altitude=80, shadedmap="elev.shad_relief"))

Error : basename: extra operand `(x86)/GRASS-65-SVN/scripts/r.shaded.relief'
Try `basename --help' for more information.
<?xml version="1.0" encoding="CP1252"?>
<!DOCTYPE task SYSTEM "grass-interface.dtd">
...
</task> does not seem to be XML, nor to identify a file name
Error in parseGRASS(cmd) : r.shaded.relief not parsed

Is this a bug or my mistake?

Thanks,
Brian

--
View this message in context: http://osgeo-org.1803224.n2.nabble.com/r-shaded-relief-spgrass6-problems-tp5742202p5742202.html
Sent from the Grass - Users mailing list archive at Nabble.com.

Off the top of my head the ‘.’ in your map name is causing problems. Technically, I think you can use any character (with a few exceptions) in map names, but it’s better to avoid most of them and stick to alphanumeric and ‘_’ to separate portions of the name.

Chris

On 15 November 2010 19:43, brian <zenlines@gmail.com> wrote:

Hello List,
I am having trouble parsing the r.shaded.relief module from R using the
spgrass6 package.
When doing it directly in GRASS, it works but an error is first returned. It
goes as follows:

r.shaded.relief map=alt shadedmap=elev.shad_relief altitude=80 --overwrite
basename: extra operand
(x86)/GRASS-65-SVN/scripts/r.shaded.relief' Try basename --help’ for more information.
basename: extra operand
(x86)/GRASS-65-SVN/scripts/r.shaded.relief' Try basename --help’ for more information.
Calculating shading, please stand by.
Color table for raster map <elev.shad_relief> set to ‘grey’
Shaded relief map created and named <elev.shad_relief>.

This looks the same in R but this causes R to cease computation. The above
command sent with R yields:

execGRASS(“r.shaded.relief”,flags=“overwrite”, parameters=list(map=“alt”,
altitude=80, shadedmap=“elev.shad_relief”))
Error : basename: extra operand (x86)/GRASS-65-SVN/scripts/r.shaded.relief' Try basename --help’ for more information.

<?xml version="1.0" encoding="CP1252"?>


does not seem to be XML, nor to identify a file name
Error in parseGRASS(cmd) : r.shaded.relief not parsed

Is this a bug or my mistake?

Thanks,
Brian


View this message in context: http://osgeo-org.1803224.n2.nabble.com/r-shaded-relief-spgrass6-problems-tp5742202p5742202.html
Sent from the Grass - Users mailing list archive at Nabble.com.


grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user

Thanks Chris,
but it returned the same error. I will note that for the future though. I stuck to that because it was an example in the ps.map part of the wiki.
Brian

On 11/16/2010 2:04 AM, Chris Carleton wrote:

Off the top of my head the ‘.’ in your map name is causing problems. Technically, I think you can use any character (with a few exceptions) in map names, but it’s better to avoid most of them and stick to alphanumeric and ‘_’ to separate portions of the name.

Chris

On 15 November 2010 19:43, brian <zenlines@gmail.com> wrote:

Hello List,
I am having trouble parsing the r.shaded.relief module from R using the
spgrass6 package.
When doing it directly in GRASS, it works but an error is first returned. It
goes as follows:

r.shaded.relief map=alt shadedmap=elev.shad_relief altitude=80 --overwrite
basename: extra operand
(x86)/GRASS-65-SVN/scripts/r.shaded.relief' Try basename --help’ for more information.
basename: extra operand
(x86)/GRASS-65-SVN/scripts/r.shaded.relief' Try basename --help’ for more information.
Calculating shading, please stand by.
Color table for raster map <elev.shad_relief> set to ‘grey’
Shaded relief map created and named <elev.shad_relief>.

This looks the same in R but this causes R to cease computation. The above
command sent with R yields:

execGRASS(“r.shaded.relief”,flags=“overwrite”, parameters=list(map=“alt”,
altitude=80, shadedmap=“elev.shad_relief”))
Error : basename: extra operand (x86)/GRASS-65-SVN/scripts/r.shaded.relief' Try basename --help’ for more information.

<?xml version="1.0" encoding="CP1252"?>


does not seem to be XML, nor to identify a file name
Error in parseGRASS(cmd) : r.shaded.relief not parsed

Is this a bug or my mistake?

Thanks,
Brian


View this message in context: http://osgeo-org.1803224.n2.nabble.com/r-shaded-relief-spgrass6-problems-tp5742202p5742202.html
Sent from the Grass - Users mailing list archive at Nabble.com.


grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user

Hi Chris,
no I didn’t know that. I have my environment as such:
the initiation of the GRASS-R interface is as such:

initGRASS(“C:/Program Files (x86)/GRASS-65-SVN”, home=tempdir(), gisDbase=gisDbase, location=“VPH_PC”, mapset=paste(“Maps”,sep=“”), override=T)
So the PATH should be “C:/Program Files (x86)/GRASS-65-SVN”

Could the space in “Program Files (x86)” be causing the problem?

execGRASS(“g.gisenv”)
GISDBASE=‘D:/GIS Database/’;
LOCATION_NAME=‘VPH_PC’;
MAPSET=‘Maps’;
GRASS_GUI=‘text’;

When looking at the r.shaded.relief script, I find no error to be returned the say anything about an operand.

One parses when one messes with grass when it is calculating:
g.message -e “In calculation, script aborted.”

Another:
g.message -e “Map <$elev> not found.”
and:
g.message -e “Input elevation map and output relief map must have different names”

hmm… As I said GRASS carries out the command just fine. This may be a problem with the XML package (a dependency of the spgrass6 package) or spgrass6 package in that R halts the computation because it thinks that GRASS is sending them an error. This post may belong in the grass-stats list.

Thank you for the help and no reason to be sorry.

Regards,
Brian

On 11/16/2010 2:35 AM, Chris Carleton wrote:

You may know this already, but the error seems to be saying something about problems with your PATH. What are your system specs? What is the full path to your GIS database that grass uses? There might be something irregular about your path, but it could also be that there is a typo in the shaded relief script that’s in your SVN version (i.e. the unusual operand it’s complaining about). Check out this webpage for more details

http://www.opengroup.org/onlinepubs/9699919799/functions/basename.html

and if you can’t find the error then try the grass-dev mailing list. Glynn or Markus or one of the other developers will likely have a good idea about why the basename function is returning an error and where it is - in case you don’t already know they are awesome when it comes to free online support for GRASS users. Hope it works out and sorry I couldn’t be of more help.

C

On 15 November 2010 20:07, Brian Oney <zenlines@gmail.com> wrote:

Thanks Chris,
but it returned the same error. I will note that for the future though. I stuck to that because it was an example in the ps.map part of the wiki.
Brian

On 11/16/2010 2:04 AM, Chris Carleton wrote:

Off the top of my head the ‘.’ in your map name is causing problems. Technically, I think you can use any character (with a few exceptions) in map names, but it’s better to avoid most of them and stick to alphanumeric and ‘_’ to separate portions of the name.

Chris

On 15 November 2010 19:43, brian <zenlines@gmail.com> wrote:

Hello List,
I am having trouble parsing the r.shaded.relief module from R using the
spgrass6 package.
When doing it directly in GRASS, it works but an error is first returned. It
goes as follows:

r.shaded.relief map=alt shadedmap=elev.shad_relief altitude=80 --overwrite
basename: extra operand
(x86)/GRASS-65-SVN/scripts/r.shaded.relief' Try basename --help’ for more information.
basename: extra operand
(x86)/GRASS-65-SVN/scripts/r.shaded.relief' Try basename --help’ for more information.
Calculating shading, please stand by.
Color table for raster map <elev.shad_relief> set to ‘grey’
Shaded relief map created and named <elev.shad_relief>.

This looks the same in R but this causes R to cease computation. The above
command sent with R yields:

execGRASS(“r.shaded.relief”,flags=“overwrite”, parameters=list(map=“alt”,
altitude=80, shadedmap=“elev.shad_relief”))
Error : basename: extra operand (x86)/GRASS-65-SVN/scripts/r.shaded.relief' Try basename --help’ for more information.

<?xml version="1.0" encoding="CP1252"?>


does not seem to be XML, nor to identify a file name
Error in parseGRASS(cmd) : r.shaded.relief not parsed

Is this a bug or my mistake?

Thanks,
Brian


View this message in context: http://osgeo-org.1803224.n2.nabble.com/r-shaded-relief-spgrass6-problems-tp5742202p5742202.html
Sent from the Grass - Users mailing list archive at Nabble.com.


grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user

Hello Brian,

On Tue, Nov 16, 2010 at 1:43 AM, brian <zenlines@gmail.com> wrote:

Hello List,
I am having trouble parsing the r.shaded.relief module from R using the
spgrass6 package.
When doing it directly in GRASS, it works but an error is first returned. It
goes as follows:

r.shaded.relief map=alt shadedmap=elev.shad_relief altitude=80 --overwrite
basename: extra operand
`(x86)/GRASS-65-SVN/scripts/r.shaded.relief'
Try `basename --help' for more information.
basename: extra operand
`(x86)/GRASS-65-SVN/scripts/r.shaded.relief'
Try `basename --help' for more information.

I think I finally found this one today. It should be fixed in 6.4.1RC2 and
later (not yet released).

Calculating shading, please stand by.
Color table for raster map <elev.shad_relief> set to 'grey'
Shaded relief map created and named <elev.shad_relief>.

This looks the same in R but this causes R to cease computation. The above
command sent with R yields:

execGRASS("r.shaded.relief",flags="overwrite", parameters=list(map="alt",
altitude=80, shadedmap="elev.shad_relief"))

Error : basename: extra operand `(x86)/GRASS-65-SVN/scripts/r.shaded.relief'
Try `basename --help' for more information.
<?xml version="1.0" encoding="CP1252"?>
<!DOCTYPE task SYSTEM "grass-interface.dtd">
...
</task> does not seem to be XML, nor to identify a file name
Error in parseGRASS(cmd) : r.shaded.relief not parsed

Is this a bug or my mistake?

A bug due to improper variable quoting in the r.shaded.relief and all
other scripts.

Markus