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

Some GRASS commands broken #10795

Closed
qgib opened this issue Jun 29, 2007 · 3 comments
Closed

Some GRASS commands broken #10795

qgib opened this issue Jun 29, 2007 · 3 comments
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! GRASS

Comments

@qgib
Copy link
Contributor

qgib commented Jun 29, 2007

Author Name: Markus Neteler (Markus Neteler)
Original Redmine Issue: 736

Redmine category:grass
Assignee: nobody -


Hi,

some GRASS commands are broken:

r.median base=CEA_cat@CEA_dati cover=CEA_aspect@CEA_dati output=aspect_median

Illegal filename. Character <'> not allowed.
Illegal filename. Character <'> not allowed.
Raster map ['CEA_aspect@CEA_dati'] not found
Illegal filename. Character <'> not allowed.
r.stats: ['CEA_aspect@CEA_dati] not found

Successfully finished

-> unclear why ' is present


r.mode base=delete cover=CEA_aspect output=del_aspetto

Illegal filename. Character <'> not allowed.
ERROR: r.stats: ['delete@CEA_dati] not found
Illegal filename. Character <'> not allowed.
Illegal filename. Character <'> not allowed.
ERROR: Raster map ['delete@CEA_dati'] not found

Same thing here.


But r.average with the same syntax works perfectly.


g.manual index
Starting browser 
<> for module index...

C:/Programmi/Quantum_GIS/grass/scripts/g.manual: ./: is a directory

this indicates that GRASS_HTML_BROWSER is undefined.

Regards,
Markus

@qgib
Copy link
Contributor Author

qgib commented Jul 1, 2007

Author Name: Markus Neteler (Markus Neteler)


Update: Shame on GRASS :-)

Glynn Clements found it:

http://grass.itc.it/pipermail/grass-dev/2007-July/032140.html

"r.median invokes r.stats via system(), using a single quote:

    strcpy (command, "r.stats -a '");
    strcat (command, G_fully_qualified_name (basemap, base_mapset));
    strcat (command, ",");
    strcat (command, G_fully_qualified_name (covermap, cover_mapset));
    strcat (command, "'");

/* strcpy (command,"cat /tmp/t"); */
    stats_fd = popen (command, "r");

    sprintf (command, "r.reclass i='%s' o='%s'",
        G_fully_qualified_name (basemap, base_mapset), outmap);

system() uses the platform's shell: /bin/sh on Unix, cmd.exe on
Windows NT/2K/XP, command.com on 95/98/ME. Single quotes won't work
with the Windows shells.

r.average doesn't quote the map names, and uses double quotes around
the output filename:

    sprintf (command, "%s -anC input=%s,%s fs=space > \\"%s\\"",
        STATS, basemap->answer, covermap->answer, tempfile1);

Using double quotes should suffice so long as the map name doesn't
contain $ or @ (a double quote would also be problematic, but isn't
legal in map names).

Ultimately, we need a Windows implementation of G_spawn_ex(), so that
we can avoid the shell altogether.
"


  • resolution was changed from to invalid
  • status_id was changed from Open to Closed

@qgib
Copy link
Contributor Author

qgib commented Jul 15, 2007

Author Name: Markus Neteler (Markus Neteler)


I have fixed r.mode, r.median, and r.statistics in GRASS 6.3-CVS to use
double quotes which are supported by MS-Windows.

Once QGIS take a new GRASS version, the problem should be cured.

Markus

@qgib
Copy link
Contributor Author

qgib commented Jul 15, 2007

Author Name: Markus Neteler (Markus Neteler)


Additionally fixed:

  • r.digit
  • r.report
  • r.transect

It seems that all raster commands are ok now.

@qgib qgib added Bug Either a bug report, or a bug fix. Let's hope for the latter! GRASS labels May 24, 2019
@qgib qgib closed this as completed May 24, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! GRASS
Projects
None yet
Development

No branches or pull requests

1 participant