Re: [GRASS-user] Re: combining and evaluating vector dbf values

2008-11-26 Thread Markus Neteler
On Tue, Nov 25, 2008 at 9:07 AM, maning sambale
[EMAIL PROTECTED] wrote:
 Nearly there but not quite:

 The final column should combine the values from the 2 columns, am I
 right that concat doesn't work with dbf?

 So this doesn't work
 echo UPDATE vectormap SET c_COVER = a_COVER || a_value | db.execute

Did you try the SQLite driver?

Just create a new mapset, define the connection with db.connect (see manual
for copy-paste command) and g.copy the map from the DBF mapset
into the sqlite mapset.
Then the joys of SQL are available.

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


[GRASS-user] Re: combining and evaluating vector dbf values

2008-11-25 Thread maning sambale
Nearly there but not quite:

The final column should combine the values from the 2 columns, am I
right that concat doesn't work with dbf?

So this doesn't work
echo UPDATE vectormap SET c_COVER = a_COVER || a_value | db.execute

cheers,
maning
On Tue, Nov 25, 2008 at 2:34 PM, maning sambale
[EMAIL PROTECTED] wrote:
 Hi,

 Answering partially to my problem.

 I found a way to update columns by from a criteria of another column

 like this:
 v.info -c overlay_trainingANDforest2002_sq
 lDisplaying column types/names for database connection of layer 1:
 INTEGER|cat
 INTEGER|a_cat
 INTEGER|a_value
 CHARACTER|a_label
 INTEGER|a_COVER
 INTEGER|b_cat
 CHARACTER|b_ID
 CHARACTER|b_TYPE
 INTEGER|c_COVER

 v.db.update map=overlay_trainingANDforest2002_sql col=c_COVER
 value=112 where=a_Cover=112

 And It's really fast for 100K records!  Now, how do make an sql
 expression by evaluationg multiple columns?

 cheers,
 maning


 On Tue, Nov 25, 2008 at 12:01 PM, maning sambale
 [EMAIL PROTECTED] wrote:
 Hi,

 Any help in doing the following:

 I have a combined vector in grass using v.overlay

 I now have a dbf table with the following
 a_value = integer
 a_value2 = integer
 b_value = string

 Now I want to combine the categories in another column (c_value) like :

 evaluate b_value, a_value, a_value2
 then assign c_value from a lookup table

 the lookup table is a set of integer values based on the various
 combinations of b_value, a_value, a_value2

 Any ideas doing this in GRASS or oodbase?

 cheers,
 maning


 --
 |-|--|
 | __.-._  |Ohhh. Great warrior. Wars not make one great. -Yoda |
 | '-._7' |Freedom is still the most radical idea of all -N.Branden|
 |  /'.-c  |Linux registered user #402901, http://counter.li.org/ |
 |  |  /T  |http://esambale.wikispaces.com/ |
 | _)_/L I http://epsg4253.wordpress.com/ |
 |-|--|




 --
 |-|--|
 | __.-._  |Ohhh. Great warrior. Wars not make one great. -Yoda |
 | '-._7' |Freedom is still the most radical idea of all -N.Branden|
 |  /'.-c  |Linux registered user #402901, http://counter.li.org/ |
 |  |  /T  |http://esambale.wikispaces.com/ |
 | _)_/L I http://epsg4253.wordpress.com/ |
 |-|--|




-- 
|-|--|
| __.-._  |Ohhh. Great warrior. Wars not make one great. -Yoda |
| '-._7' |Freedom is still the most radical idea of all -N.Branden|
|  /'.-c  |Linux registered user #402901, http://counter.li.org/ |
|  |  /T  |http://esambale.wikispaces.com/ |
| _)_/L I http://epsg4253.wordpress.com/ |
|-|--|
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user


[GRASS-user] Re: combining and evaluating vector dbf values

2008-11-24 Thread maning sambale
Hi,

Answering partially to my problem.

I found a way to update columns by from a criteria of another column

like this:
v.info -c overlay_trainingANDforest2002_sq
lDisplaying column types/names for database connection of layer 1:
INTEGER|cat
INTEGER|a_cat
INTEGER|a_value
CHARACTER|a_label
INTEGER|a_COVER
INTEGER|b_cat
CHARACTER|b_ID
CHARACTER|b_TYPE
INTEGER|c_COVER

v.db.update map=overlay_trainingANDforest2002_sql col=c_COVER
value=112 where=a_Cover=112

And It's really fast for 100K records!  Now, how do make an sql
expression by evaluationg multiple columns?

cheers,
maning


On Tue, Nov 25, 2008 at 12:01 PM, maning sambale
[EMAIL PROTECTED] wrote:
 Hi,

 Any help in doing the following:

 I have a combined vector in grass using v.overlay

 I now have a dbf table with the following
 a_value = integer
 a_value2 = integer
 b_value = string

 Now I want to combine the categories in another column (c_value) like :

 evaluate b_value, a_value, a_value2
 then assign c_value from a lookup table

 the lookup table is a set of integer values based on the various
 combinations of b_value, a_value, a_value2

 Any ideas doing this in GRASS or oodbase?

 cheers,
 maning


 --
 |-|--|
 | __.-._  |Ohhh. Great warrior. Wars not make one great. -Yoda |
 | '-._7' |Freedom is still the most radical idea of all -N.Branden|
 |  /'.-c  |Linux registered user #402901, http://counter.li.org/ |
 |  |  /T  |http://esambale.wikispaces.com/ |
 | _)_/L I http://epsg4253.wordpress.com/ |
 |-|--|




-- 
|-|--|
| __.-._  |Ohhh. Great warrior. Wars not make one great. -Yoda |
| '-._7' |Freedom is still the most radical idea of all -N.Branden|
|  /'.-c  |Linux registered user #402901, http://counter.li.org/ |
|  |  /T  |http://esambale.wikispaces.com/ |
| _)_/L I http://epsg4253.wordpress.com/ |
|-|--|
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user