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

maning sambale emmanuel.sambale at gmail.com
Tue Nov 25 03:07:23 EST 2008


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
<emmanuel.sambale at gmail.com> 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
> <emmanuel.sambale at gmail.com> 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/ |
|---------|----------------------------------------------------------|


More information about the grass-user mailing list