Re: [GRASS-user] batch file processiong stops with some db-commands
On Sat, Mar 12, 2011 at 5:48 PM, Matthias Klingel wrote: > > Dear grass users, > in wingrass 6.4.1 (or at least on my machine), processing of batch files with > grass commands stops after executing v.db.addtable, v.db.addcol, v.db.addcol, > v.db.dropcol and their db.* equivalents. The rest of the batch file will not > be processed. Of course, there is a workaround using SQL commands with > db.execute, but this is substantially more typing work. Anybody has the same > problem and knows how to fix it? Do you use the DBF driver? Perhaps you are hit by this bug: http://trac.osgeo.org/grass/ticket/1308 Hopefully solved soon... Markus ___ grass-user mailing list grass-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-user
Re: [GRASS-user] Error while removing file
António Rocha wrote: > I'm trying to remove a file named new_clump@Area and I get this error: > [new_clump@Area] is a base map for [myscript.tmpV@Area]. Remove forced. "is a base map for" is just a warning; it doesn't prevent removal so long as the -f flag is given. > misc: couldn't be removed This indicates that there was some problem with removing the cell_misc directory. -- Glynn Clements ___ grass-user mailing list grass-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-user
[GRASS-user] db.out.ogr: Syntax Correction
Hi >> Why don't you try with g.copy? > > My reading of the man page is that g.copy copies maps from a non-current >mapset to the current one. I don't see how to use this to copy attribute >data from dbf to pg. db.connect - Prints/sets general DB connection for current mapset and exits. http://grass.osgeo.org/grass64/manuals/html64_user/db.connect.html just an example: location abc with two mapsets mapset dbfASdb <= with dbf as DB set by db.connect mapset pgASdb <= with pg as DB set by db.connect if you g.copy your vectors from mapset dbfASdb to mapset pgASdb, all the attributes are also copied from dbf to pg. HTH Helmut ___ WEB.DE DSL Doppel-Flat ab 19,99 €/mtl.! Jetzt mit gratis Handy-Flat! http://produkte.web.de/go/DSL_Doppel_Flatrate/2 smime.p7s Description: S/MIME Cryptographic Signature ___ grass-user mailing list grass-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-user
Re: [GRASS-user] db.out.ogr: Syntax Correction
On Mon, 14 Mar 2011, Rich Shepard wrote: # Copy to postgres I had a syntax error in the db.copy command. 6.5 is running now, but I'm now getting a different error. For background, db.connect -p shows: GRASS 6.5.svn (Nevada-aea):~/grassdata > db.connect -p driver:pg database:host=localhost,dbname=nevada schema:public group: So we're OK there. Now the db.copy command tells me of a missing dbf attribute table: GRASS 6.5.svn (Nevada-aea):~/grassdata > db.copy from_dri=dbf to_dri=pg to_data="host=localhost,dbname=nevada" from_tab=at_risk_species to_tab=at_risk_species DBMI-DBF driver error: Table 'at_risk_species' doesn't exist. Error in db_open_select_cursor() Yet, when I look in that directory, there it is: [rshepard@salmo ~/grassdata/Nevada-aea/PERMANENT/dbf]$ ls at_risk_species.dbf Is this a syntax error on my part? Thanks, Rich ___ grass-user mailing list grass-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-user
Re: [GRASS-user] 6.5svn build problem [SOLVED]
On Mon, 14 Mar 2011, Martin Landa wrote: run `make distclean` before `configure`. Martin, Thank you. I've not had to run make distclean on previous builds of the svn code so it did not occur to me. It did fix the problem, however. Much appreciated, Rich ___ grass-user mailing list grass-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-user
Re: [GRASS-user] db.out.ogr: Syntax Correction
On Mon, 14 Mar 2011, Micha Silver wrote: Hmmm is right. On my (debian) I get: # check columns in a vector GRASS 6.4.1svn (Nevada-aea):~/grassdata > v.info -c at_risk_species Displaying column types/names for database connection of layer 1: INTEGER|cat INTEGER|EO_ID_NUM DOUBLE PRECISION|EO_NUM CHARACTER|SNAME CHARACTER|SCOMNAME ... # Which current db connection? GRASS 6.4.1svn (Nevada-aea):~/grassdata > v.db.connect -p at_risk_species Vector map is connected by: layer <1> table in database through driver with key # Copy to postgres GRASS 6.4.0RC6 (ITM):~ > db.copy from_dri=dbf to_dri=pg to_data="host=localhost,dbname=geodata" from_tab=idan_catchments to_tab=idan_catchments GRASS 6.4.1svn (Nevada-aea):~/grassdata > db.copy from_dri=dbf to_dri=pg to_data="host=localhost,dbname=at_risk_species" from_tab=at_risk_species to_tab=at_risk_species dbmi: Protocol error WARNING: Unable to open database by driver Same problem as with 6.5svn (the running version before yesterday). Why don't you try with g.copy? My reading of the man page is that g.copy copies maps from a non-current mapset to the current one. I don't see how to use this to copy attribute data from dbf to pg. Thanks, Rich ___ grass-user mailing list grass-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-user
Re: [GRASS-user] 6.5svn build problem
Hi, 2011/3/14 Rich Shepard : > Yesterday, 13 March, I ran 'svn up' to get the latest 6.5 source then ran > configure; make; make install. No errors reported. However, when I start > this version I see: run `make distclean` before `configure`. Martin -- Martin Landa * http://geo.fsv.cvut.cz/~landa ___ grass-user mailing list grass-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-user
[GRASS-user] 6.5svn build problem
Yesterday, 13 March, I ran 'svn up' to get the latest 6.5 source then ran configure; make; make install. No errors reported. However, when I start this version I see: Welcome to GRASS 6.5.svn (2010) GRASS homepage: http://grass.osgeo.org/ This version running thru: Bash Shell (/bin/bash) Help is available with the command: g.manual -i See the licence terms with: g.version -c If required, restart the GUI with: g.gui wxpython When ready to quit enter:exit GRASS 6.5.svn (Nevada-aea):~/grassdata > ERROR: Incompatible library version for module. You need to rebuild GRASS or untangle multiple installations. I've no idea for which module there is an incompatible library version. The latest 6.4svn code does not display this error when I fire it up. I'll be happy to provide more information if one of you developers suggests how I can generate more informative messages. Rich ___ grass-user mailing list grass-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-user
[GRASS-user] Not accepted characters for mapset name
[please keep it on the mailing list, so others can benefit of it] for example the official grassgis-sample-dataset of north carolina is named "nc_spm_08" (http://grass.osgeo.org/download/data.php) HTH Helmut - Von: "Nikos Dumakis" Gesendet: 14.03.2011 10:29:04 An: "Helmut Kudrnovsky" Betreff: Re: Not accepted characters for mapset name THank you Helmut. So, as far as I can see, I'm able to use _ as MAPSET name right? ___ Schon gehört? WEB.DE hat einen genialen Phishing-Filter in die Toolbar eingebaut! http://produkte.web.de/go/toolbar ___ grass-user mailing list grass-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-user
Re: [GRASS-user] GRASS'c Python core function to use as g.mlist
Hi Jenny > Because I got this error: > p=grass.mlist_grouped ('rast', pattern=pattern, > mapset='PERMANENT') This command runs fine on my system (by replacing 'pattern' with a valid pattern string'). Maybe it is a version problem? I'm running GRASS 6.4.0 on Ubuntu 10.10, coming from the ubuntugis-unstable repository. > If I avoid using mapset I get a dictionary variable in which, each entry is > the list of rasters for each MAPSET. Maybe you can solve your problem by discarding the rest of the output. If you only want the rasters present in the 'PERMANENT' mapset and since mlist_grouped returns a dictionary with mapset names as keys, you can keep just the value associated with the 'PERMANENT' key. So, you can just do: # returns a list with rasters present in the 'PERMANENT' mapset p = grass.mlist_grouped('rast', pattern=pattern)['PERMANENT'] On Mon, Mar 14, 2011 at 3:00 PM, Jenny Turner wrote: > Hello Ricardo > Thanks for your feedback but the problem is that mapset cannot be used as > input. > Because I got this error: > p=grass.mlist_grouped ('rast', pattern=pattern, > mapset='PERMANENT') > TypeError: mlist_grouped() got an unexpected keyword > argument 'mapset'. > If I avoid using mapset I get a dictionary variable in which, each entry is > the list of rasters for each MAPSET. > Am I doing something wrong? > Thanks > Jenny > On Fri, Mar 11, 2011 at 2:29 PM, Ricardo Filipe Soares Garcia da > wrote: >> >> Hi Jenny >> >> Long story short: use your command like this (note the asterisk on the >> 'pattern' variable): >> >> # python code >> p=grass.mlist_grouped ('rast', pattern='output*', mapset='Mapping') >> >> >> I am using the Ipython shell to script grass. It has a cool feature, >> that if you type the name of a function followed by two question >> marks, you can see the source code of the function (as long as it is >> coded in python itself). >> So, in doing: >> >> grass.mlist_grouped?? >> >> It is possible to see that the mlist_grouped function is internally >> calling the 'g.mlist' command with only the 'm' flag. >> >> Reading the documentation for the g.mlist command [1], I realize that, >> without using the -r or -e flags, this command accepts wildcards[2] as >> the 'pattern' string. The asterisk (*) is the wildcard character for >> substituting for any zero or more characters. So, in order to get a >> string that starts with 'output' and after that can have anything, you >> just type 'output*' >> >> >> [1] - http://grass.fbk.eu/grass64/manuals/html64_user/g.mlist.html >> [2] - http://en.wikipedia.org/wiki/Wildcard_character#Computing >> >> >> On Fri, Mar 11, 2011 at 12:10 PM, Jenny Turner >> wrote: >> > Greetings >> > I'm doing a GRASS Python Script where I need to list a set of raster >> > maps >> > but I'm not using its exact name but a basic regular expression (r flag >> > in >> > g.mlist function). >> > So I want to find a list of rasters with output on its name: >> > p=grass.mlist_grouped ('rast', pattern='output', mapset='Mapping') >> > But I get null entries because no raster map is named output only >> > output01 >> > output02 output03 ... >> > I want to list all raster maps with output on itsd name. How can I do >> > this >> > using grass.mlist_grouped? >> > Thanks >> > Jenny >> > ___ >> > grass-user mailing list >> > grass-user@lists.osgeo.org >> > http://lists.osgeo.org/mailman/listinfo/grass-user >> > >> > >> >> >> >> -- >> ___ ___ __ >> Ricardo Garcia Silva > > -- ___ ___ __ Ricardo Garcia Silva ___ grass-user mailing list grass-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-user
Re: [GRASS-user] GRASS'c Python core function to use as g.mlist
Hello Ricardo Thanks for your feedback but the problem is that mapset cannot be used as input. Because I got this error: p=grass.mlist_grouped ('rast', pattern=pattern, mapset='PERMANENT') TypeError: mlist_grouped() got an unexpected keyword argument 'mapset'. If I avoid using mapset I get a dictionary variable in which, each entry is the list of rasters for each MAPSET. Am I doing something wrong? Thanks Jenny On Fri, Mar 11, 2011 at 2:29 PM, Ricardo Filipe Soares Garcia da < ricardo.garcia.si...@gmail.com> wrote: > Hi Jenny > > Long story short: use your command like this (note the asterisk on the > 'pattern' variable): > > # python code > p=grass.mlist_grouped ('rast', pattern='output*', mapset='Mapping') > > > I am using the Ipython shell to script grass. It has a cool feature, > that if you type the name of a function followed by two question > marks, you can see the source code of the function (as long as it is > coded in python itself). > So, in doing: > > grass.mlist_grouped?? > > It is possible to see that the mlist_grouped function is internally > calling the 'g.mlist' command with only the 'm' flag. > > Reading the documentation for the g.mlist command [1], I realize that, > without using the -r or -e flags, this command accepts wildcards[2] as > the 'pattern' string. The asterisk (*) is the wildcard character for > substituting for any zero or more characters. So, in order to get a > string that starts with 'output' and after that can have anything, you > just type 'output*' > > > [1] - http://grass.fbk.eu/grass64/manuals/html64_user/g.mlist.html > [2] - http://en.wikipedia.org/wiki/Wildcard_character#Computing > > > On Fri, Mar 11, 2011 at 12:10 PM, Jenny Turner > wrote: > > Greetings > > I'm doing a GRASS Python Script where I need to list a set of raster maps > > but I'm not using its exact name but a basic regular expression (r flag > in > > g.mlist function). > > So I want to find a list of rasters with output on its name: > > p=grass.mlist_grouped ('rast', pattern='output', mapset='Mapping') > > But I get null entries because no raster map is named output only > output01 > > output02 output03 ... > > I want to list all raster maps with output on itsd name. How can I do > this > > using grass.mlist_grouped? > > Thanks > > Jenny > > ___ > > grass-user mailing list > > grass-user@lists.osgeo.org > > http://lists.osgeo.org/mailman/listinfo/grass-user > > > > > > > > -- > ___ ___ __ > Ricardo Garcia Silva > ___ grass-user mailing list grass-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-user
[GRASS-user] Error while removing file
Greetings I'm trying to remove a file named new_clump@Area and I get this error: [new_clump@Area] is a base map for [myscript.tmpV@Area]. Remove forced. misc: couldn't be removed I'm already using -f flag from g.remove function. myscript.tmpV was a file that I generated from this new_clump. But, now I don't have that file in Area MAPSET ( I already checked in the Area folder) so I wasn't suppose to get this error. How can I remove this raster without getting this nonsense error Thanks Best regards, Antonio R. __ Information from ESET NOD32 Antivirus, version of virus signature database 5952 (20110314) __ The message was checked by ESET NOD32 Antivirus. http://www.eset.com ___ grass-user mailing list grass-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-user