[GRASS-user] db.execute transactions

2009-11-12 Thread Vincent Bain
Hi List,
working on grass65 svn, with the pg dbms driver, I am trying to run
several slq statements from a shell script. These statements are
generated within a loop and I would like them to be executed in a
transaction.
I see it might not be possible this way :

echo BEGIN TRANSACTION; | db.execute
echo myfirststatement; | db.execute
echo mysecondstatement | db.execute
...
echo COMMIT; | db.execute

as it returns 

WARNING:  there is no transaction in progress

Should I dump all the commands in a temporary file $tmp then run
db.execute input=$tmp ? or is there a better way ?

Thank you,
Vincent.


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


[GRASS-user] GRASS in EMACS with ESS - how to send more than one line at a time

2009-11-12 Thread Adam Wilson
I use GRASS and R within a EMACS-ESS environment, which works quite well
overall.  I can keep a script that uses both GRASS and R in a single script
file and bounce back and forth between them as I need for analysis (i.e.
system(grass64 /media/Data/Work/grassdata/CFR/biomass) to go to GRASS
from R, and R to go to R from GRASS).  When within a R environment, I can
send multiple lines from a buffer to the R proccess with a C-c C-r
keystroke, which works brilliantly.

But when I am in the GRASS environment, I am only able to send one line at a
time or it will hang until I hit C-g (which results in only the first line
of the region being sent).  I imagine that this is because ESS is waiting
for the standard R prompt  before sending the next line, but while in
GRASS the prompt is something more like GRASS 6.4.0RC5
(CFR):/grassdata/map  so ESS doesn't know that the previous command is
finished and just waits until I cancel it with C-g.   Anyone found a
solution to this problem?

Thanks,
Adam
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user


Re: [GRASS-user] installing addon problem for regular users (ubuntu newbies)

2009-11-12 Thread Glynn Clements

M S wrote:

 I'm on Kubuntu 9.10, using both 32 and 64 bit systems.  This output is
 from 32bit.  It is GRASS 6.4 RC5.  Seems to be the same logged issue
 of defaulting to /build rather than /var/lib/grass64
 
 -
 I ran sudo make MODULE_TOPDIR=/usr/lib/grass64
 
 This is the first line of output  gcc
 -I/build/buildd/grass-6.4.0~rc5/dist.i486-pc-linux-gnu/include  -Wall
 -g -O-I/usr/include/gdal-DPACKAGE=\grassmods\
 -I/build/buildd/grass-6.4.0~rc5/dist.i486-pc-linux-gnu/include -o
 OBJ.i486-pc-linux-gnu/close.o -c close.c  
 ---
 
 If I apply the GRASS_HOME=/usr/lib/grass64:
 
 --
 $ sudo make MODULE_TOPDIR=/usr/lib/grass64 GRASS_HOME=/usr/lib/grass64
 
 gcc -I/usr/lib/grass64/dist.i486-pc-linux-gnu/include  -Wall -g -O
 -I/usr/include/gdal-DPACKAGE=\grassmods\
 -I/usr/lib/grass64/dist.i486-pc-linux-gnu/include -o
 OBJ.i486-pc-linux-gnu/close.o -c close.c
 close.c:1:23: error: grass/gis.h: No such file or  directory
 close.c:2:27: error: grass/glocale.h: No such file or directory
 close.c:3:24: error: grass/dbmi.h: No such file or directory
 close.c:4:24: error: grass/Vect.h: No such file or directory
 -
 
 Should it be looking in /usr/lib/grass64/include, instead of
 /usr/lib/grass64/dist.i486-pc-linux-gnu/include ?   The latter
 directory is empty.
 
 If so, how do I remove the dist.i486-pc-linux--gnu portion from the
 gcc statement?

You could try ARCH_DISTDIR=/usr/lib/grass64, but this may not be
sufficient for complex cases. If you need to search both the installed
version and the build directory for headers and/or libraries, you will
need to set ARCH_INC and/or ARCH_LIBPATH explicitly.

If you still have problems, look at the first two sections of
Grass.make; this defines the most important variables.

6.x is still a bit of a mess in this regard.

In 7.0, ARCH_DISTDIR controls where output files go, while GISBASE
controls where existing libraries and headers are found. Both
$(ARCH_DISTDIR)/include and $(GISBASE)/include are searched for
headers, and both $(ARCH_DISTDIR)/lib and $(GISBASE)/lib are searched
for libraries. This allows a package to use both existing headers and
libraries and those which are part of the package.

RUN_GISBASE is the value of GISBASE used when running GRASS modules as
part of the build process (on Windows, this will be in Windows format
rather than MSys format).

MODULE_TOPDIR is only used to locate the *.make files; everything else
uses the variables from those files.

-- 
Glynn Clements gl...@gclements.plus.com
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user


Re: [GRASS-user] installing addon problem for regular users (ubuntu newbies)

2009-11-12 Thread M S
Thanks Glynn. I failed to mention the GRASS 6.4RC5 is from UbuntuGIS
with binaries and grass-dev package installed.

It seemed to have worked (?) with errors, or I've been mucking around
too much and missed some detail from prior trial.  Seems to have
error'd while making the manpages.  I can launch r.stream.extract, and
it runs the module. (Nice!).  Here is the input/output (should long
outputs like this go to pastebin or the like?):

$ sudo make MODULE_TOPDIR=/usr/lib/grass64 ARCH_DISTDIR=/usr/lib/grass64
gcc -I/usr/lib/grass64/include  -Wall -g -O-I/usr/include/gdal
-DPACKAGE=\grassmods\  -I/usr/lib/grass64/include -o
OBJ.i486-pc-linux-gnu/close.o -c close.c

close.c: In function ‘close_streamvect’:
close.c:33: warning: format not a string literal and no format arguments
close.c:155: warning: format not a string literal and no format arguments
close.c:187: warning: format not a string literal and no format arguments
close.c:213: warning: format not a string literal and no format arguments
close.c:221: warning: format not a string literal and no format arguments
close.c: In function ‘close_maps’:
close.c:245: warning: format not a string literal and no format arguments
gcc -I/usr/lib/grass64/include  -Wall -g -O-I/usr/include/gdal
-DPACKAGE=\grassmods\  -I/usr/lib/grass64/include -o
OBJ.i486-pc-linux-gnu/del_streams.o -c del_streams.c
gcc -I/usr/lib/grass64/include  -Wall -g -O-I/usr/include/gdal
-DPACKAGE=\grassmods\  -I/usr/lib/grass64/include -o
OBJ.i486-pc-linux-gnu/do_astar.o -c do_astar.c
do_astar.c: In function ‘do_astar’:
do_astar.c:33: warning: format not a string literal and no format
arguments
do_astar.c: In function ‘heap_add’:
do_astar.c:154: warning: format not a string literal and no format
arguments
gcc -I/usr/lib/grass64/include  -Wall -g -O-I/usr/include/gdal
-DPACKAGE=\grassmods\  -I/usr/lib/grass64/include -o
OBJ.i486-pc-linux-gnu/flag_clr_all.o -c flag_clr_all.c
gcc -I/usr/lib/grass64/include  -Wall -g -O-I/usr/include/gdal
-DPACKAGE=\grassmods\  -I/usr/lib/grass64/include -o
OBJ.i486-pc-linux-gnu/flag_create.o -c flag_create.c
gcc -I/usr/lib/grass64/include  -Wall -g -O-I/usr/include/gdal
-DPACKAGE=\grassmods\  -I/usr/lib/grass64/include -o
OBJ.i486-pc-linux-gnu/flag_destroy.o -c flag_destroy.c
gcc -I/usr/lib/grass64/include  -Wall -g -O-I/usr/include/gdal
-DPACKAGE=\grassmods\  -I/usr/lib/grass64/include -o
OBJ.i486-pc-linux-gnu/flag_get.o -c flag_get.c
gcc -I/usr/lib/grass64/include  -Wall -g -O-I/usr/include/gdal
-DPACKAGE=\grassmods\  -I/usr/lib/grass64/include -o
OBJ.i486-pc-linux-gnu/flag_set.o -c flag_set.c
gcc -I/usr/lib/grass64/include  -Wall -g -O-I/usr/include/gdal
-DPACKAGE=\grassmods\  -I/usr/lib/grass64/include -o
OBJ.i486-pc-linux-gnu/flag_unset.o -c flag_unset.c
gcc -I/usr/lib/grass64/include  -Wall -g -O-I/usr/include/gdal
-DPACKAGE=\grassmods\  -I/usr/lib/grass64/include -o
OBJ.i486-pc-linux-gnu/load.o -c load.c
load.c: In function ‘load_maps’:
load.c:44: warning: format not a string literal and no format
arguments
load.c:46: warning: format not a string literal and no format
arguments
load.c:56: warning: format not a string literal and no format
arguments
load.c:65: warning: format not a string literal and no format
arguments
load.c:75: warning: format not a string literal and no format
arguments
load.c:217: warning: format not a string literal and no format
arguments
gcc -I/usr/lib/grass64/include  -Wall -g -O-I/usr/include/gdal
-DPACKAGE=\grassmods\  -I/usr/lib/grass64/include -o
OBJ.i486-pc-linux-gnu/main.o -c main.c
main.c: In function ‘main’:
main.c:195: warning: format not a string literal and no format
arguments
main.c:246: warning: format not a string literal and no format
arguments
main.c:254: warning: format not a string literal and no format
arguments
main.c:259: warning: format not a string literal and no format
arguments
main.c:267: warning: format not a string literal and no format
arguments
main.c:276: warning: format not a string literal and no format
arguments
main.c:281: warning: format not a string literal and no format
arguments
main.c:287: warning: format not a string literal and no format
arguments
gcc -I/usr/lib/grass64/include  -Wall -g -O-I/usr/include/gdal
-DPACKAGE=\grassmods\  -I/usr/lib/grass64/include -o
OBJ.i486-pc-linux-gnu/rbtree.o -c rbtree.c
gcc -I/usr/lib/grass64/include  -Wall -g -O-I/usr/include/gdal
-DPACKAGE=\grassmods\  -I/usr/lib/grass64/include -o
OBJ.i486-pc-linux-gnu/streams.o -c streams.c
streams.c: In function ‘do_accum’:
streams.c:234: warning: format not a string literal and no format
arguments
streams.c: In function ‘extract_streams’:
streams.c:460: warning: format not a string literal and no format
arguments
gcc -I/usr/lib/grass64/include  -Wall -g -O-I/usr/include/gdal
-DPACKAGE=\grassmods\  -I/usr/lib/grass64/include -o
OBJ.i486-pc-linux-gnu/thin.o -c thin.c
thin.c: In function ‘thin_streams’:
thin.c:92: warning: format 

[GRASS-user] Problems with adjacency

2009-11-12 Thread Sebastian_2009

I'm new to GRASS and I am trying to replicate the following script (from the
documentation for v.to.db) to identify adjacency in polygons:

# add boundary categories into geometry at layer 2:
v.category soils out=mysoils layer=2 type=boundary option=add
# add table with left/right column to layer 2:
v.db.addtable mysoils layer=2 col=left integer,right integer
# upload categories of left/right polygons:
v.to.db mysoils option=sides col=left,right layer=2
# display the result:
v.db.select mysoils layer=2

I have a version of the script in Python that I run in the GRASS command
Line on windows (from the GRASS 6.4.0SVN windows installation).

When my script gets to the 'v.to.db' command it pauses and a shell prompt is
put on the screen with no further information.  I have no idea what it
expects or why the shell prompt appears.  If I type 'exit' I get the
following message:
ERROR: Database connection not defined for layer. Use v.db.connect first

If I insert a v.db.connect statement into the code I get the shell prompt
again (also with no further comment) but this time where the v.db.addtable
command is.  I assume that it is trying (and failing) to tell me that the
table already exists).

If I repeat the entire exercise with a new category (say 'mysoils2') plus
the v.db.connect statement I STILL get the blank shell prompt but this time
typing 'exit' gives me an error for every boundary which says 'Error in
db_execute_immediate(), Column 'left' not found.

Can anybody help me please?

Thanks
-- 
View this message in context: 
http://n2.nabble.com/Problems-with-adjacency-tp3994065p3994065.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


Re: [GRASS-user] r.in.arc Beyond the Man Page

2009-11-12 Thread Allan Hollander
Rich,

Also when you use r.in.gdal to import the data from the Arc/Info grid 
directory, you reference the hdr.adf file as the input source.

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


Re: [GRASS-user] r.in.arc Beyond the Man Page

2009-11-12 Thread Rich Shepard

On Thu, 12 Nov 2009, Allan Hollander wrote:


Also when you use r.in.gdal to import the data from the Arc/Info grid
directory, you reference the hdr.adf file as the input source.


Allan,

  That is essential information. Thank you. Since I've no idea what the
various files are for I would not know where to begin.

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


Re: [GRASS-user] GRASS in EMACS with ESS - how to send more than one line at a time

2009-11-12 Thread Glynn Clements

Adam Wilson wrote:

 I use GRASS and R within a EMACS-ESS environment, which works quite well
 overall.  I can keep a script that uses both GRASS and R in a single script
 file and bounce back and forth between them as I need for analysis (i.e.
 system(grass64 /media/Data/Work/grassdata/CFR/biomass) to go to GRASS
 from R, and R to go to R from GRASS).  When within a R environment, I can
 send multiple lines from a buffer to the R proccess with a C-c C-r
 keystroke, which works brilliantly.
 
 But when I am in the GRASS environment, I am only able to send one line at a
 time or it will hang until I hit C-g (which results in only the first line
 of the region being sent).  I imagine that this is because ESS is waiting
 for the standard R prompt  before sending the next line, but while in
 GRASS the prompt is something more like GRASS 6.4.0RC5
 (CFR):/grassdata/map  so ESS doesn't know that the previous command is
 finished and just waits until I cancel it with C-g.   Anyone found a
 solution to this problem?

Try adding:

export PS1=' '

to ~/.grass.bashrc.

Beyond that, consider bypassing the grass64 script for any
unconventional use of GRASS. It really isn't suitable for anything
other than its intended usage (being run from a terminal to create an
interactive session).

-- 
Glynn Clements gl...@gclements.plus.com
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user


[GRASS-user] Web Site Firefox Issues

2009-11-12 Thread Rich Shepard

  Using Firefox-3.0.15 on Slackware-12.2 I cannot get past the first page.
Every link produces a blank page with a 2x2 GIF meter asp. Opera works OK,
but not Firefox. Anyone know why?

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


Re: [GRASS-user] grid legend

2009-11-12 Thread Hamish
try d.grid with grid line color set to none, and especially ps.out from
wiki addons.



Hamish


--- On Wed, 11/11/09, Martin Album Ytre-Eide wrote:

 From: Martin Album Ytre-Eide martin.album.ytre-e...@nrpa.no
 Subject: [GRASS-user] grid legend
 To: grass-user@lists.osgeo.org grass-user@lists.osgeo.org
 Date: Wednesday, November 11, 2009, 1:40 AM
 Hello.
 
 I wont to do something similar to what is done in:
 http://www.gdf-hannover.de/lit_html/grass60_v1.2_en/node81.html
 in figure 36 and 38 (processing figures with xfig). Having
 a figure where you could see the coordinates of your points
 
 The problem is to generate x and y-axes with numbers,
 surrounding the map. 
 d.grid gives something similar, but I cant seem to turn of
 the grid lines and the numbers are inside the map.
 tried ps.map, but can't  move the numbers outside the
 x and y lines (see attachment) 
 
 If anyone has any suggestions how to do this or know how
 this is done with xfig, I would appreciate it.
 
 Thanks.
 
 Martin Ytre-Eide




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