Re: [GRASS-user] Map Collars (missing attachment)

2009-04-02 Thread Markus Neteler
On Thu, Apr 2, 2009 at 12:49 AM, Hamish hamis...@yahoo.com wrote:
...
 hmmm, the shell script attachment seems to have been removed at some point.
 Did the listserv settings change?

Yes, yesterday (to convert text/html parts to plain text). I hoped
that it would do
the job correctly and not eat other attachments.
Since it doesn't, previous setting restored, no more mangling now (as before).

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


[GRASS-user] grass coide gisRc

2009-04-02 Thread apachemaven
I find some java code to call the grass commond,i am confusing with some 
parmeters:
--
 /**
  * Define all environment variables needed by Grass
  * 
  * @param gisBase
  *Directory where GRASS lives.
  * @param gisRcreate
  *Define if an existing GISRC file as to be used.
  * @param gisRc
  *Name of .grassrc6 file. GISRCRC defines the system wide value
  *while in a GRASS session.
  * @param mapset
  *Initial mapset directory which is a subdirectory of
  *LOCATION_NAME
  * @param location
  *Initial location directory which is a subdirectory of GISDBASE
  * @param gisDBase
  *Initial database directory which should be a fully qualified
  *path (eg /usr/local/share/grassdata).
  * @param proj
  *Projection code.
  */
 public void setEnv(String gisBase, String gisRcreate, String gisRc,
   String mapset, String location, String gisDBase, String proj)
---
what is the difference between gisRcreate and the gisRc
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user


Re: [GRASS-user] problems with i.rectify

2009-04-02 Thread Martina Schäfer

Hello Markus,

thanks for the reply! And thanks for the tip on i.orto.photo, I will 
read through your article!

I've followed the instructions
and everything's working fine except that the red band is not included. In
the output it says :
Rectified input file NN1_2.red will be saved as NN1_2.red 1257



I see a suspicious white space before 1257.
Where does it come from? Could it be that it crept
in when defining the group?
  
Well, the space was my fault and a typing mistake, it really says 
NN1_2.red1257, so no error there.


In the mapset there is a group/ directory in which the
group is defined (ASCII file). The easiest way is to check
there/fix if the red channel was defined properly.
  
I looked in the group folder and found a file REF where all bands are 
properly named. Was that the file you meant?
The group is defined in the XY location. In the projected location it 
does not exist prior to rectifying.



BTW: which GRASS version and which operating system?
  
I'm using GRASS 6.3. downloaded from http://grass.bologna.enea.it/ on 
Mac OS X 10.5.6


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


Re: [GRASS-user] concurrent versions of grass

2009-04-02 Thread Vincent Bain
Thank you, I'll try it

VB


Le mercredi 01 avril 2009 à 22:53 +0200, Markus Neteler a écrit :
 Unless you don't use GEM then you are fine to remove/rename it.
 
 Markus
 
 On Wed, Apr 1, 2009 at 10:33 PM, Vincent Bain b...@toraval.fr wrote:
  In my case, what if I voluntarily remove gem6 before installing a second
  version of Grass ? will the previous grass install be damaged ?
 
 
 
  Le mercredi 01 avril 2009 à 22:28 +0200, Markus Neteler a écrit :
  On Wed, Apr 1, 2009 at 10:24 PM, Vincent Bain b...@toraval.fr wrote:
   Perhaps,
  
   but it could be interesting to check whether the error is reproductible,
 
  Yes: because in all GRASS 6 versions it is called gem6 (unfortunately).
  So it must conflict...
  If the others agree I'll start to add the second version number starting
  with GRASS 6.5. Then behaviour doesn't change for 6.4.
 
  Markus
 
 
 
 

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


Re: [GRASS-user] v.dissolve and r.cost problems

2009-04-02 Thread Paolo Cavallini
Michael Barton ha scritto:

 Do you have a lot of null cells in your region?

None. Tested also with a r.fractal surface, same results.
All the best.
-- 
Paolo Cavallini: http://faunalia.it/pc
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user


Re: [GRASS-user] v.dissolve and r.cost problems

2009-04-02 Thread Paolo Cavallini
Glynn Clements ha scritto:

 The entire notion of least cost is based upon the assumption that
 the cost must always be non-negative.

Bingo, you got it!
I had (by my mistake in mapcalc parameters) a few negative cells.
Now r.cost runs, and I'doing further testing.
I think your suggestions should be implemented: in the current situation
the user doesn't have a clue of what is the problem.
Thanks a lot!
-- 
Paolo Cavallini: http://faunalia.it/pc
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user


Re: [GRASS-user] Re: [GRASS-dev] call for volunteers - urgent need for Windows Vista binaries

2009-04-02 Thread Moritz Lennert

On 31/03/09 06:58, Martin Landa wrote:

Hi,

2009/3/31 Michael Barton michael.bar...@asu.edu:

Native, stand alone installer for GRASS should be a high priority. I guess
we need both an XP and Vista version.


personally I have no problem with osgeo4w installer. Ideally should be
mentained both - standalone and osgeo4w - if we have enough manpower.
If no, I would incline to osgeo4w.


I can only repeat that the two are not opposed, but that you can create 
a standalone installer on the basis of osgeo4w:


http://trac.osgeo.org/osgeo4w/wiki/FAQ#HowdoIperformanofflineorcomputerlabinstall

AFAICT, you just need to create the .bat file mentioned in the QGIS blog 
and you have a clickable installer.


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


Re: [GRASS-user] problems with i.rectify

2009-04-02 Thread Markus Neteler
hi Martina,

On Thu, Apr 2, 2009 at 9:28 AM, Martina Schäfer
martina.scha...@ebc.uu.se wrote:
 Hello Markus,

 thanks for the reply! And thanks for the tip on i.orto.photo, I will read
 through your article!

 I've followed the instructions
 and everything's working fine except that the red band is not included.
 In
 the output it says :
 Rectified input file NN1_2.red will be saved as NN1_2.red 1257


 I see a suspicious white space before 1257.
 Where does it come from? Could it be that it crept
 in when defining the group?


 Well, the space was my fault and a typing mistake, it really says
 NN1_2.red1257, so no error there.

ah ok, perfect.

 In the mapset there is a group/ directory in which the
 group is defined (ASCII file). The easiest way is to check
 there/fix if the red channel was defined properly.


 I looked in the group folder and found a file REF where all bands are
 properly named. Was that the file you meant?

Yes, fine.

 The group is defined in the XY location. In the projected location it does
 not exist prior to rectifying.

 BTW: which GRASS version and which operating system?


 I'm using GRASS 6.3. downloaded from http://grass.bologna.enea.it/ on Mac OS
 X 10.5.6

I recall that we fixed some issues later. Could you upgrade to 6.4RC3
instead?
http://grass.osgeo.org/download/index.php#g64x

If it still fails we may be able to fix it for 6.4.0 final.

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


Re: [GRASS-stats] Re: [GRASS-user] Testing i.pca ~ prcomp(), m.eigensystem ~ princomp()

2009-04-02 Thread Nikos Alexandris
Nikos:
  If outputs are not identical, either R or grass do some hidden
  modification or there is a bug in either grass or R (all within
  limits, e.g. identical up to the 5th digit in scientific format is
  fine?).
  Some textbooks give a rule of thumb for further analysis to use only
  components with an eigenvalue =1

 I think this depends on what you are trying to achieve. Of course,
 components with small(-er) eigenvalues include more noizzze. In my
 change detection project I used *only* components with eigenvalues 
 1.

Hmm.. Markus, I was too quick yesterday. That's not true. All of the
PC's I've used have eigenvalue  1. Sorry :-p

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


Re: [GRASS-user] v.dissolve and r.cost problems

2009-04-02 Thread Markus Neteler
On Wed, Apr 1, 2009 at 6:05 PM, Paolo Cavallini cavall...@faunalia.it wrote:
 Hi all.
 I cannot get a result from v.dissolve:

 v.dissolve input=reg...@nuovo layer=1 column=REGIAO output=reg_diss
 dbmi: Protocol error
 Cannot open select cursor: SELECT cat, REGIAO FROM regiao ORDER BY REGIAO
 Unable to open vector map on topology level 2
 Table linked to vector map does not exist
 Vector map not found in current mapset
...
  6.3.0.1-gfossit20090216-1

I got your data set and found:
GRASS 6.5.svn (portugal):~  echo SELECT cat, REGIAO FROM regiao
ORDER BY REGIAO | db.select
dbmi: Protocol error

GRASS 6.5.svn (portugal):~  echo SELECT cat, REGIAO FROM regiao | db.select
cat|REGIAO
1|NOROESTE CISMONTANO
2|ALTO PORTUGAL
3|ALTO PORTUGAL

but in db/driver/dbfexe.c I see

/* Order */
if (st-command == SQLP_SELECT  st-orderCol) {
G_debug(3, Order selection by %s, st-orderCol);

/* Find order col */
cur_cmp_ocol = -1;

which suggests to me that ORDER BY should be supported.
Not sure why it fails.

Quick solution for you: use the SQLite driver.

Looking at
What's new in GRASS 6.3.0
* Source code quality/libraries:
...
  o DBMI: SQL parser extended (support for DROP COLUMN,
ASC/DESC keyword in ORDER BY clause, etc.)

?

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


RE: [GRASS-user] openGL library name

2009-04-02 Thread Patton, Eric
Not sure. But I work with NVidia and have the following  under
/usr/include/GL$ ls -l

-rw-r--r-- 1 root root 376506 2009-01-06 22:13 glext.h
-rw-r--r-- 1 root root  72949 2009-01-06 22:13 gl.h
-rw-r--r-- 1 root root  17163 2008-10-22 05:58 glu.h
-rw-r--r-- 1 root root   3315 2008-10-22 05:58 glu_mangle.h
-rw-r--r-- 1 root root  33751 2009-01-06 22:13 glxext.h
-rw-r--r-- 1 root root  14021 2009-01-06 22:13 glx.h

Do you have all of those installed as well?
Nikos

Yep, looks good:

cd /usr/include/GL
GL ls -l
total 692
-rw-r--r-- 1 root root   5028 2008-05-10 09:20 freeglut_ext.h
-rw-r--r-- 1 root root681 2008-05-10 09:20 freeglut.h
-rw-r--r-- 1 root root  23684 2008-05-10 09:20 freeglut_std.h
-rw-r--r-- 1 root root 388018 2008-10-22 00:51 glext.h
-rw-r--r-- 1 root root  90754 2008-10-22 00:51 gl.h
-rw-r--r-- 1 root root  83950 2008-10-22 00:51 gl_mangle.h
-rw-r--r-- 1 root root  17163 2008-10-22 00:58 glu.h
-rw-r--r-- 1 root root   3315 2008-10-22 00:58 glu_mangle.h
-rw-r--r-- 1 root root639 2008-05-10 09:20 glut.h
-rw-r--r-- 1 root root  33458 2008-10-22 00:51 glxext.h
-rw-r--r-- 1 root root  15234 2008-10-22 00:51 glx.h
-rw-r--r-- 1 root root   3412 2008-10-22 00:51 glx_mangle.h
drwxr-xr-x 2 root root   4096 2008-10-29 10:12 internal

All of your files plus some mangle headers to boot.

~ Eric.



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


RE: [GRASS-stats] Re: [GRASS-user] Testing i.pca ~ prcomp(), m.eigensystem ~ princomp()

2009-04-02 Thread Patton, Eric
 than 1. The reasoning is fairly weak, but goes like this: if a PC has
 eigenvalue  1, it explains more variance than any of the original
 variables, which all have variance 1.
 
 Maybe I should Cc: this to the wiki.
 --
 Edzer

Or even better include it in the docs if there is anything in your post 
that does a better job explaining the module. I'm completely unfamiliar with
these modules, but could you suggest some portions of your explanation that 
would be useful for inclusion in the documentation?

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


RE: [GRASS-user] openGL library name

2009-04-02 Thread Patton, Eric
It's entirely possible that the nVidia OpenGL package doesn't have a
corresponding development package. In which case, you probably need to
make the symlink manually, e.g.:

   ln -s libGL.so.1.2 /usr/lib/libGL.so

Essentially libGL.so must exist in one of the system library
directories (e.g. /usr/lib) and must point (directly or indirectly) at
the actual OpenGL library (which will normally have a version number
after the .so).

Thanks, Glynn! That was exactly what was wrong.

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


[GRASS-user] individual based models in GRASS

2009-04-02 Thread Milton Cezar Ribeiro
Hi there,

I am looking to stay in touch with those are working
with Individual Based Models (IBM) in GRASS.
My intent is to simulate movement patterns of virtual
species mimicing real behaviour as response of
landscape structure.

Thanks a lot,

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


Re: [GRASS-user] v.dissolve and r.cost problems

2009-04-02 Thread Markus Neteler
On Thu, Apr 2, 2009 at 1:43 PM, Markus Neteler nete...@osgeo.org wrote:
 On Wed, Apr 1, 2009 at 6:05 PM, Paolo Cavallini cavall...@faunalia.it wrote:
 Hi all.
 I cannot get a result from v.dissolve:

 v.dissolve input=reg...@nuovo layer=1 column=REGIAO output=reg_diss
 dbmi: Protocol error
 Cannot open select cursor: SELECT cat, REGIAO FROM regiao ORDER BY REGIAO
 Unable to open vector map on topology level 2
 Table linked to vector map does not exist
 Vector map not found in current mapset
 ...
  6.3.0.1-gfossit20090216-1

 I got your data set and found:
 GRASS 6.5.svn (portugal):~  echo SELECT cat, REGIAO FROM regiao
 ORDER BY REGIAO | db.select
 dbmi: Protocol error

 GRASS 6.5.svn (portugal):~  echo SELECT cat, REGIAO FROM regiao | db.select
 cat|REGIAO
 1|NOROESTE CISMONTANO
 2|ALTO PORTUGAL
 3|ALTO PORTUGAL

 but in db/driver/dbfexe.c I see

    /* Order */
    if (st-command == SQLP_SELECT  st-orderCol) {
        G_debug(3, Order selection by %s, st-orderCol);

        /* Find order col */
        cur_cmp_ocol = -1;

 which suggests to me that ORDER BY should be supported.
 Not sure why it fails.

Offlist we figured it out:
If the REGIAO column field value is empty, then it fails. Perhaps
only happening with char columns. Somewhere here:

http://trac.osgeo.org/grass/browser/grass/branches/releasebranch_6_4/db/drivers/dbf/dbfexe.c#L644

Any ideas why?

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


Re: [GRASS-user] v.dissolve and r.cost problems

2009-04-02 Thread Moritz Lennert

On 02/04/09 16:00, Markus Neteler wrote:

On Thu, Apr 2, 2009 at 1:43 PM, Markus Neteler nete...@osgeo.org wrote:

On Wed, Apr 1, 2009 at 6:05 PM, Paolo Cavallini cavall...@faunalia.it wrote:

Hi all.
I cannot get a result from v.dissolve:

v.dissolve input=reg...@nuovo layer=1 column=REGIAO output=reg_diss
dbmi: Protocol error
Cannot open select cursor: SELECT cat, REGIAO FROM regiao ORDER BY REGIAO
Unable to open vector map on topology level 2
Table linked to vector map does not exist
Vector map not found in current mapset

...

 6.3.0.1-gfossit20090216-1

I got your data set and found:
GRASS 6.5.svn (portugal):~  echo SELECT cat, REGIAO FROM regiao
ORDER BY REGIAO | db.select
dbmi: Protocol error

GRASS 6.5.svn (portugal):~  echo SELECT cat, REGIAO FROM regiao | db.select
cat|REGIAO
1|NOROESTE CISMONTANO
2|ALTO PORTUGAL
3|ALTO PORTUGAL

but in db/driver/dbfexe.c I see

   /* Order */
   if (st-command == SQLP_SELECT  st-orderCol) {
   G_debug(3, Order selection by %s, st-orderCol);

   /* Find order col */
   cur_cmp_ocol = -1;

which suggests to me that ORDER BY should be supported.
Not sure why it fails.


Offlist we figured it out:
If the REGIAO column field value is empty, then it fails. Perhaps
only happening with char columns. Somewhere here:

http://trac.osgeo.org/grass/browser/grass/branches/releasebranch_6_4/db/drivers/dbf/dbfexe.c#L644


My wild guess would be that the problem is rather in the cmp_row_asc 
function, where you have on line 481:


case DBF_CHAR:
c1 = tbl-rows[*row1].values[cur_cmp_ocol].c;
c2 = tbl-rows[*row2].values[cur_cmp_ocol].c;
return (strcmp(c1, c2));
break;

Don't know how strcmp handles empty values. Maybe you could add 
something like


fprinf(stdout, c1 = %s, c2 = %s\n, a, b);

before the return statement to see the state of the respective character 
variables ?


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


Re: [GRASS-user] v.dissolve and r.cost problems

2009-04-02 Thread Markus Neteler
On Thu, Apr 2, 2009 at 4:51 PM, Moritz Lennert
mlenn...@club.worldonline.be wrote:
 On 02/04/09 16:00, Markus Neteler wrote:
 On Thu, Apr 2, 2009 at 1:43 PM, Markus Neteler nete...@osgeo.org wrote:
 On Wed, Apr 1, 2009 at 6:05 PM, Paolo Cavallini cavall...@faunalia.it

 v.dissolve input=reg...@nuovo layer=1 column=REGIAO output=reg_diss
 dbmi: Protocol error
...
 Offlist we figured it out:
 If the REGIAO column field value is empty, then it fails. Perhaps
 only happening with char columns. Somewhere here:


 http://trac.osgeo.org/grass/browser/grass/branches/releasebranch_6_4/db/drivers/dbf/dbfexe.c#L644

 My wild guess would be that the problem is rather in the cmp_row_asc
 function, where you have on line 481:

    case DBF_CHAR:
        c1 = tbl-rows[*row1].values[cur_cmp_ocol].c;
        c2 = tbl-rows[*row2].values[cur_cmp_ocol].c;
        return (strcmp(c1, c2));
        break;

 Don't know how strcmp handles empty values. Maybe you could add something
 like

 fprinf(stdout, c1 = %s, c2 = %s\n, a, b);

 before the return statement to see the state of the respective character
 variables ?

Very good :)

echo SELECT cat, REGIAO FROM regiao ORDER BY REGIAO | db.select
D0/0: c1 = ALTO PORTUGAL, c2 = ALTO PORTUGAL
D0/0: c1 = NOROESTE CISMONTANO, c2 = ALTO PORTUGAL
D0/0: c1 = NOROESTE CISMONTANO, c2 = ALTO PORTUGAL
D0/0: c1 = NOROESTE CISMONTANO, c2 = ALTO PORTUGAL
D0/0: c1 = (null), c2 = ALTO PORTUGAL
dbmi: Protocol error

BAD happens when Null is found here.

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


Re: [GRASS-user] v.dissolve and r.cost problems

2009-04-02 Thread Moritz Lennert

On 02/04/09 16:58, Markus Neteler wrote:

On Thu, Apr 2, 2009 at 4:51 PM, Moritz Lennert
mlenn...@club.worldonline.be wrote:

On 02/04/09 16:00, Markus Neteler wrote:

On Thu, Apr 2, 2009 at 1:43 PM, Markus Neteler nete...@osgeo.org wrote:

On Wed, Apr 1, 2009 at 6:05 PM, Paolo Cavallini cavall...@faunalia.it

v.dissolve input=reg...@nuovo layer=1 column=REGIAO output=reg_diss
dbmi: Protocol error

...

Offlist we figured it out:
If the REGIAO column field value is empty, then it fails. Perhaps
only happening with char columns. Somewhere here:


http://trac.osgeo.org/grass/browser/grass/branches/releasebranch_6_4/db/drivers/dbf/dbfexe.c#L644

My wild guess would be that the problem is rather in the cmp_row_asc
function, where you have on line 481:

   case DBF_CHAR:
   c1 = tbl-rows[*row1].values[cur_cmp_ocol].c;
   c2 = tbl-rows[*row2].values[cur_cmp_ocol].c;
   return (strcmp(c1, c2));
   break;

Don't know how strcmp handles empty values. Maybe you could add something
like

fprinf(stdout, c1 = %s, c2 = %s\n, a, b);

before the return statement to see the state of the respective character
variables ?


Very good :)

echo SELECT cat, REGIAO FROM regiao ORDER BY REGIAO | db.select
D0/0: c1 = ALTO PORTUGAL, c2 = ALTO PORTUGAL
D0/0: c1 = NOROESTE CISMONTANO, c2 = ALTO PORTUGAL
D0/0: c1 = NOROESTE CISMONTANO, c2 = ALTO PORTUGAL
D0/0: c1 = NOROESTE CISMONTANO, c2 = ALTO PORTUGAL
D0/0: c1 = (null), c2 = ALTO PORTUGAL
dbmi: Protocol error

BAD happens when Null is found here.


And that's arguably a correct behaviour as how should NULL be handled in 
such a comparison ? Don't know how it is dealt with in other DBMS...


So, before we fix this in any way, we should probably agree to how to 
handle it. One possible way would be to check for nulls and if there are 
any to assign a return value according to our choice as to where to sort 
nulls to. Don't know how to check for an uninitialised char variable in 
C, but I imagine that it should be possible.


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


Re: [GRASS-user] v.dissolve and r.cost problems

2009-04-02 Thread Moritz Lennert

On 02/04/09 18:12, Moritz Lennert wrote:

On 02/04/09 16:58, Markus Neteler wrote:

On Thu, Apr 2, 2009 at 4:51 PM, Moritz Lennert
mlenn...@club.worldonline.be wrote:

On 02/04/09 16:00, Markus Neteler wrote:
On Thu, Apr 2, 2009 at 1:43 PM, Markus Neteler nete...@osgeo.org 
wrote:
On Wed, Apr 1, 2009 at 6:05 PM, Paolo Cavallini 
cavall...@faunalia.it

v.dissolve input=reg...@nuovo layer=1 column=REGIAO output=reg_diss
dbmi: Protocol error

...

Offlist we figured it out:
If the REGIAO column field value is empty, then it fails. Perhaps
only happening with char columns. Somewhere here:


http://trac.osgeo.org/grass/browser/grass/branches/releasebranch_6_4/db/drivers/dbf/dbfexe.c#L644 


My wild guess would be that the problem is rather in the cmp_row_asc
function, where you have on line 481:

   case DBF_CHAR:
   c1 = tbl-rows[*row1].values[cur_cmp_ocol].c;
   c2 = tbl-rows[*row2].values[cur_cmp_ocol].c;
   return (strcmp(c1, c2));
   break;

Don't know how strcmp handles empty values. Maybe you could add 
something

like

fprinf(stdout, c1 = %s, c2 = %s\n, a, b);

before the return statement to see the state of the respective character
variables ?


Very good :)

echo SELECT cat, REGIAO FROM regiao ORDER BY REGIAO | db.select
D0/0: c1 = ALTO PORTUGAL, c2 = ALTO PORTUGAL
D0/0: c1 = NOROESTE CISMONTANO, c2 = ALTO PORTUGAL
D0/0: c1 = NOROESTE CISMONTANO, c2 = ALTO PORTUGAL
D0/0: c1 = NOROESTE CISMONTANO, c2 = ALTO PORTUGAL
D0/0: c1 = (null), c2 = ALTO PORTUGAL
dbmi: Protocol error

BAD happens when Null is found here.


And that's arguably a correct behaviour as how should NULL be handled in 
such a comparison ? Don't know how it is dealt with in other DBMS...


So, before we fix this in any way, we should probably agree to how to 
handle it. One possible way would be to check for nulls and if there are 
any to assign a return value according to our choice as to where to sort 
nulls to. Don't know how to check for an uninitialised char variable in 
C, but I imagine that it should be possible.


Actually, you should be able to check 
tbl-rows[*row1].values[cur_cmp_ocol].is_null


and deal with the values accordingly, but from a casual glimpse I cannot 
find the possible values of is_null... I suppose 0 for false and 1 for 
true, but not sure...Use your example to check, with something like


fprintf(stdout, row 1 null status = %i\n, 
tbl-rows[*row1].values[cur_cmp_ocol].is_null);


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


Re: [GRASS-user] individual based models in GRASS

2009-04-02 Thread Michael Barton



On Apr 2, 2009, at 9:00 AM, grass-user-requ...@lists.osgeo.org wrote:


From: Milton Cezar Ribeiro miltinho.astrona...@gmail.com
Date: April 2, 2009 6:19:08 AM GMT-07:00
To: grassu...@grass.itc.it
Subject: [GRASS-user] individual based models in GRASS


Hi there,

I am looking to stay in touch with those are working
with Individual Based Models (IBM) in GRASS.
My intent is to simulate movement patterns of virtual
species mimicing real behaviour as response of
landscape structure.

Thanks a lot,

milton
Brazil/Toronto.



There is a grass_abm list (ABM = IBM). It doesn't have much traffic  
yet, but contributors like you could change that.


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


[GRASS-user] Error in sqlite3_step()

2009-04-02 Thread Craig Leat
I am receiving the following error when patching two point vector maps:
v.patch -e in=SBC1,SBC2 out=SBC_0607
Patching vector map s...@craig...
DBMI-SQLite driver error:
Error in sqlite3_step():
SQL logic error or missing database

ERROR: Cannot insert new record: 'insert into SBC_0607 values ( 64510,
   'Dwelling', 'The Msunduzi', 37)'

The attribute tables look like this :
v.info -c SBC1
Displaying column types/names for database connection of layer 1:
INTEGER|cat
CHARACTER|CLASS_NAME
CHARACTER|LM
INTEGER|WARD

v.info -c SBC2
Displaying column types/names for database connection of layer 1:
INTEGER|cat
CHARACTER|CLASS_NAME
CHARACTER|LM
INTEGER|WARD

I have checked disk space and file size of the sqlite db - no problems
there. Any ideas why sqlite chokes on cat 64510?

sqlite 3.4.2
grass 6.5
ubuntu 7.10

Thanks,

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


[GRASS-user] displaying many thematic maps from one vector dataset

2009-04-02 Thread Vishal Mehta
Hello all,

I am better at GRASS raster capabilities than with GRASS vector handling, so
I am writing to get your help.

What I want to do is this:
1. I will have one vector dataset of watersheds. Each record is a polygon,
an individual watershed. There are, apart from the usual cat fields, 52
attribute columns. Each attribute column is modeled weekly snow depth.

2. I need to automate the display and export to png of 52 thematic images -
one for each week/column - keeping the color scheme constant throughout.
Then all of the images will be packaged into a kml animation.

I know how to do the above starting from a stack of GRASS rasters, but am
not quickly getting a handle on displaying GRASS vectors consistently. I've
tried d.vect and d.vect.thematic. I havent tried d.thematic.area yet.

The main issues are that I dont know:
- how to assign a constant color scheme  to each map (that spans the min and
max of all columns); i guess i was looking for something as simple as
setting color rules like with raster data.

- how to refer to each attribute column by column number in a loop
(d.vect.thematic and d.thematic.area  seem to need column name as attribute)

Any pointers would be greatly appreciated,
Vishal

Vishal K. Mehta, PhD
Scientist
Stockholm Environment Institute - US
133 D St Suite F
Davis CA 95616
www.sei-us.org
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user


[GRASS-user] meaning of r.param.scale features colours?

2009-04-02 Thread Paolo Cavallini
Hi all.
I cannot find the meaning of the colours (values) produced by
r.param.scale features; it is quite obvious that reds are peaks, green
saddles, but I cannot find a full description. Wouldn't it be good to
put it on the manpage?
All the best.
-- 
Paolo Cavallini: http://faunalia.it/pc
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user