Re: [GRASS-user] location/mapset naming restrictions
Thank you, Glynn :) ___ grass-user mailing list grass-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-user
Re: [GRASS-user] location/mapset naming restrictions
On Tue, Dec 1, 2015 at 2:40 AM, Glynn Clements wrote: > > Panagiotis Mavrogiorgos wrote: > >> Are there any restrictions to the location/mapset names? > > They may not contain any of the characters: [...] Thanks, Glynn, for these detailed explanations. So save them for the future, cited here now: https://grasswiki.osgeo.org/wiki/Location_and_Mapsets#Restrictions_to_the_location.2Fmapset_names Markus ___ grass-user mailing list grass-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-user
Re: [GRASS-user] location/mapset naming restrictions
Panagiotis Mavrogiorgos wrote: > Are there any restrictions to the location/mapset names? They may not contain any of the characters: / " ' @ , = * or space, DEL (code 127/0x7F), any control character or any 8-bit character. [source: lib/gis/legal_name.c] Also, because map, mapset and location names are used directly as file and/or directory names, they may not contain any character which is prohibited in a filename by the underlying OS. On Windows, this includes: \ / : * ? " < > | [source: try entering any of these characters when renaming a file or directory on Windows.] The OS may also impose other restrictions (e.g. you typically can't have a file or directory named "." or ".." although the "." character isn't itself prohibited). > I just found out that if you use a numeric mapset (e.g. 2014_123) you have > to use single quotes in mapcalc expressions. Which names are legal and which names can be used in r.mapcalc without quoting are different. E.g. a "-" character (minus, hyphen, dash) is legal in a map, mapset or location name, but r.mapcalc requires the name to be quoted, otherwise it will be interpreted as a subtraction. > e.g the following example will > raise an error: > > r.mapcalc expression="foo=R1@2014_123" > > results in: > > syntax error, unexpected INTEGER, expecting VARNAME or NAME An unquoted name consists of a sequence of characters other than space, control characters, or any of: ^ # @ , " ' ( ) [ ] + - * / % > < ! = & | ? : ; ~ [source: raster/r.mapcalc/mapcalc.l, definition of "N" (line 97).] *However*: it may not have a prefix which is a valid integer or floating-point literal (which is why your example above generates an error), as those take precedence over names. A quoted name can contain any character other than the quote character itself. Note that quoted names aren't always maps (or mapsets or locations); they can also be used for variables if you feel you have to use a name which isn't valid as an unquoted name. -- Glynn Clements ___ grass-user mailing list grass-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-user
Re: [GRASS-user] location/mapset naming restrictions
Panagiotis Mavrogiorgos: > Are there any restrictions to the location/mapset names? If I read this (following) correctly, the definition is in "grass70/dist.x86_64-unknown-linux-gnu/include/grass/defs/gis.h", line 427 and after: --%<--- /* make_mapset.c */ int G_make_mapset(const char *, const char *, const char *); /* mapcase.c */ char *G_tolcase(char *); char *G_toucase(char *); /* mapset.c */ const char *G_mapset(void); char *G_mapset_path(void); /* mapset_msc.c */ int G_make_mapset_element(const char *); int G__make_mapset_element_misc(const char *, const char *); int G_mapset_permissions(const char *); int G_mapset_permissions2(const char *, const char *, const char *); --->%-- Isn't this answering the question, ie restricting the option to have a number as the first character in a Mapset's name? Nikos ___ grass-user mailing list grass-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-user
Re: [GRASS-user] location/mapset naming restrictions
On Wed, Nov 25, 2015 at 7:28 PM, Panagiotis Mavrogiorgos wrote: > It took me sometime to figure it out,* and in retrospect you can imply > this from the r.mapcalc manual, but I couldn't find any specific reference > for naming restrictions. So, are there any? The manual talks about map names, but if you think that it can be improved, please suggest the changes. Vaclav https://grass.osgeo.org/grass70/manuals/r.mapcalc.html#raster-map-layer-names ___ grass-user mailing list grass-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-user
[GRASS-user] location/mapset naming restrictions
Hi all, Are there any restrictions to the location/mapset names? I just found out that if you use a numeric mapset (e.g. 2014_123) you have to use single quotes in mapcalc expressions. e.g the following example will raise an error: r.mapcalc expression="foo=R1@2014_123" results in: syntax error, unexpected INTEGER, expecting VARNAME or NAME It took me sometime to figure it out,* and in retrospect you can imply this from the r.mapcalc manual, but I couldn't find any specific reference for naming restrictions. So, are there any? with kind regards, Panos * actually Nikos Alexandris did... ___ grass-user mailing list grass-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-user