[GRASS-user] Raster names under Linux

Hamish hamish_b at yahoo.com
Tue Feb 2 17:56:41 EST 2010


Niels:
> > I wrote a script for GRASS 6.4 under Ubuntu, in which
> > I included the commands r.in.gdal and g.region rast=xxx.
> > When runningthe script I received error messages illegal
> > file name and character <not allowed. How could I overcome
> > this problem ?

quoting error? non-english character?

Rich wrote:
>   Do the file names contain an underscore '_'? GRASS
> doesn't like that. Hyphens ('-') seem to be OK.

? underscores are fine. Hyphens are ok for raster maps but
must be quoted for r.mapcalc so it doesn't mistake it for a
minus sign. Vector names must be SQL compliant (stricker set,
can't start with a number, ...)


the full list of bannded chars for all GRASS maps/regions can
be found in lib/gis/legal_nme.c:

if (*s == '/' || *s == '"' || *s == '\'' || *s <= ' ' ||
    *s == '@' || *s == ',' || *s == '=' || *s == '*' || *s > 0176) {
   fprintf(stderr,
      _("Illegal filename. Character <%c> not allowed.\n"), *s);
        return -1;


Hamish



      


More information about the grass-user mailing list