[GRASS5] New thematic mapper for GRASS 6

Jachym Cepicky jachym.cepicky at centrum.cz
Thu May 12 08:47:40 EDT 2005


hi
On Thu, May 12, 2005 at 11:39:20AM +0200, Martin Landa wrote:
> 
> Maybe to add a new flag to d.vect.thematic (-s print sql) to store grassrgb?
> 
> d.vect.thematic -s | db.execute
> 
> Martin

I added the -u flag, which serves for updating the color values to database. it also
looks, if there is any GRASSRGB column in the table..

unfortunatly d.vect.thematic (without -u flag) seems to be faster, than 
d.vect -a 

d.vect.thematic could be renamed to v.thematic... or even v.colors :-) ?

Jachym

-- 
Jachym Cepicky
e-mail: jachym.cepicky at centrum.cz
URL: http://les-ejk.cz
GPG: http://www.fle.czu.cz/~jachym/gnupg_public_key/
-------------- next part --------------
109a110,116
> #%flag
> #% key: u
> #% description: Update color values to the table
> #%end
> 
> # setting environment, so that awk works properly in all languages
> export LC_NUMERIC=C
140a148,161
> # update color values to the table?
> if [ "$GIS_FLAG_u -eq 1" ] ; then
>     # which is the database table?
>     table=`v.db.connect -g $GIS_OPT_map |grep $GIS_OPT_layer | awk '{print $2}'`
>     
>     # test, if the column GRASSRGB is in the table
>     if [ "`db.columns $table | grep -i grassrgb`" == "" ] ; then
>         echo "Creating column 'grassrgb' in table '$table'"
>         "ALTER TABLE $table ADD COLUMN grassrgb varchar(11)"|db.execute
>     fi
> 
> fi
> 
> 
230a252,259
>             
>             # update color to database?
>             sqlwhere="$GIS_OPT_column>$rangemin and $GIS_OPT_column<=$rangemax"
>             if [ $GIS_FLAG_u -eq 1 ] ; then
>                 echo "UPDATE $table SET GRASSRGB = '$themecolor' WHERE $sqlwhere"\
>            | db.execute
>             fi
> 
232c261
<                 where="$GIS_OPT_column>$rangemin and $GIS_OPT_column<=$rangemax" \
---
>                 where="$sqlwhere" \
263a293,300
>         # update color to database?
>         sqlwhere="$GIS_OPT_column>$rangemin and $GIS_OPT_column<=$rangemax"
>         if [ $GIS_FLAG_u -eq 1 ] ; then
>            echo "UPDATE $table SET GRASSRGB = '$themecolor' WHERE  $sqlwhere"\
>            | db.execute
>         fi
> 
> 
265c302
<             where="$GIS_OPT_column>$rangemin and $GIS_OPT_column<=$rangemax" \
---
>             where="$sqlwhere" \
284a322,328
>         # update color to database?
>         sqlwhere="$GIS_OPT_column>$rangemin and $GIS_OPT_column<=$rangemax"
>         if [ $GIS_FLAG_u -eq 1 ] ; then
>            echo "UPDATE $table SET GRASSRGB = '$themecolor' WHERE  $sqlwhere"\
>            | db.execute
>         fi
> 
286c330
<             where="$GIS_OPT_column>$rangemin and $GIS_OPT_column<=$rangemax" \
---
>             where="$sqlwhere" \
301a346,352
>         # update color to database?
>         sqlwhere="$GIS_OPT_column>$rangemin and $GIS_OPT_column<=$rangemax" 
>         if [ $GIS_FLAG_u -eq 1 ] ; then
>            echo "UPDATE $table SET GRASSRGB = '$themecolor' WHERE  $sqlwhere"\
>            | db.execute
>         fi
> 
303c354
<             where="$GIS_OPT_column>$rangemin and $GIS_OPT_column<=$rangemax" \
---
>             where="$sqlwhere" \
322a374,381
> 
>         # update color to database?
>         sqlwhere="$GIS_OPT_column>$rangemin and $GIS_OPT_column<=$rangemax" 
>         if [ $GIS_FLAG_u -eq 1 ] ; then
>            echo "UPDATE $table SET GRASSRGB = '$themecolor' WHERE  $sqlwhere"\
>            | db.execute
>         fi
> 
324c383
<             where="$GIS_OPT_column>$rangemin and $GIS_OPT_column<=$rangemax" \
---
>             where="$sqlwhere" \
343a403,409
>         # update color to database?
>         sqlwhere="$GIS_OPT_column>$rangemin and $GIS_OPT_column<=$rangemax" 
>         if [ $GIS_FLAG_u -eq 1 ] ; then
>            echo "UPDATE $table SET GRASSRGB = '$themecolor' WHERE  $sqlwhere"\
>            | db.execute
>         fi
> 
345c411
<             where="$GIS_OPT_column>$rangemin and $GIS_OPT_column<=$rangemax" \
---
>             where="$sqlwhere" \
360a427,433
>         # update color to database?
>         sqlwhere="$GIS_OPT_column>$rangemin and $GIS_OPT_column<=$rangemax" 
>         if [ $GIS_FLAG_u -eq 1 ] ; then
>            echo "UPDATE $table SET GRASSRGB = '$themecolor' WHERE  $sqlwhere"\
>            | db.execute
>         fi
> 
362c435
<             where="$GIS_OPT_column>$rangemin and $GIS_OPT_column<=$rangemax" \
---
>             where="$sqlwhere" \
382a456,462
>         # update color to database?
>         sqlwhere="$GIS_OPT_column>$rangemin and $GIS_OPT_column<=$rangemax" 
>         if [ $GIS_FLAG_u -eq 1 ] ; then
>            echo "UPDATE $table SET GRASSRGB = '$themecolor' WHERE  $sqlwhere"\
>            | db.execute
>         fi
> 
384c464
<             where="$GIS_OPT_column>$rangemin and $GIS_OPT_column<=$rangemax" \
---
>             where="$sqlwhere" \
399a480,486
>         # update color to database?
>         sqlwhere="$GIS_OPT_column>$rangemin and $GIS_OPT_column<=$rangemax" 
>         if [ $GIS_FLAG_u -eq 1 ] ; then
>            echo "UPDATE $table SET GRASSRGB = '$themecolor' WHERE  $sqlwhere"\
>            | db.execute
>         fi
> 
401c488
<             where="$GIS_OPT_column>$rangemin and $GIS_OPT_column<=$rangemax" \
---
>             where="$sqlwhere" \
416a504,510
>         # update color to database?
>         sqlwhere="$GIS_OPT_column>$rangemin and $GIS_OPT_column<=$rangemax" 
>         if [ $GIS_FLAG_u -eq 1 ] ; then
>            echo "UPDATE $table SET GRASSRGB = '$themecolor' WHERE  $sqlwhere"\
>            | db.execute
>         fi
> 
418c512
<             where="$GIS_OPT_column>$rangemin and $GIS_OPT_column<=$rangemax" \
---
>             where="$sqlwhere" \
433a528,534
>         # update color to database?
>         sqlwhere="$GIS_OPT_column>$rangemin and $GIS_OPT_column<=$rangemax" 
>         if [ $GIS_FLAG_u -eq 1 ] ; then
>            echo "UPDATE $table SET GRASSRGB = '$themecolor' WHERE  $sqlwhere"\
>            | db.execute
>         fi
> 
435c536
<             where="$GIS_OPT_column>$rangemin and $GIS_OPT_column<=$rangemax" \
---
>             where="$sqlwhere" \
457a559,565
>         # update color to database?
>         sqlwhere="$GIS_OPT_column>$rangemin and $GIS_OPT_column<=$rangemax" 
>         if [ $GIS_FLAG_u -eq 1 ] ; then
>            echo "UPDATE $table SET GRASSRGB = '$themecolor' WHERE  $sqlwhere"\
>            | db.execute
>         fi
> 
459c567
<                 where="$GIS_OPT_column>$rangemin and $GIS_OPT_column<=$rangemax" \
---
>                 where="$sqlwhere" \
484a593,599
>         # update color to database?
>         sqlwhere="$GIS_OPT_column>$rangemin and $GIS_OPT_column<=$rangemax" 
>         if [ $GIS_FLAG_u -eq 1 ] ; then
>            echo "UPDATE $table SET GRASSRGB = '$themecolor' WHERE  $sqlwhere"\
>            | db.execute
>         fi
> 
486c601
<             where="$GIS_OPT_column>$rangemin and $GIS_OPT_column<=$rangemax" \
---
>             where="$sqlwhere" \
497a613,619
>         # update color to database?
>         sqlwhere="$GIS_OPT_column>$rangemin and $GIS_OPT_column<=$rangemax" 
>         if [ $GIS_FLAG_u -eq 1 ] ; then
>            echo "UPDATE $table SET GRASSRGB = '$themecolor' WHERE  $sqlwhere"\
>            | db.execute
>         fi
> 
499c621
<             where="$GIS_OPT_column>$rangemin and $GIS_OPT_column<=$rangemax" \
---
>             where="$sqlwhere" \
506a629,635
>         # update color to database?
>         sqlwhere="$GIS_OPT_column>$rangemin and $GIS_OPT_column<=$rangemax" 
>         if [ $GIS_FLAG_u -eq 1 ] ; then
>            echo "UPDATE $table SET GRASSRGB = '$themecolor' WHERE  $sqlwhere"\
>            | db.execute
>         fi
> 
508c637
<             where="$GIS_OPT_column>$rangemin and $GIS_OPT_column<=$rangemax" \
---
>             where="$sqlwhere" \
519a649,655
>         # update color to database?
>         sqlwhere="$GIS_OPT_column>$rangemin and $GIS_OPT_column<=$rangemax" 
>         if [ $GIS_FLAG_u -eq 1 ] ; then
>            echo "UPDATE $table SET GRASSRGB = '$themecolor' WHERE  $sqlwhere"\
>            | db.execute
>         fi
> 
521c657
<             where="$GIS_OPT_column>$rangemin and $GIS_OPT_column<=$rangemax" \
---
>             where="$sqlwhere" \
532a669,675
>         # update color to database?
>         sqlwhere="$GIS_OPT_column>$rangemin and $GIS_OPT_column<=$rangemax" 
>         if [ $GIS_FLAG_u -eq 1 ] ; then
>            echo "UPDATE $table SET GRASSRGB = '$themecolor' WHERE  $sqlwhere"\
>            | db.execute
>         fi
> 
534c677
<             where="$GIS_OPT_column>$rangemin and $GIS_OPT_column<=$rangemax" \
---
>             where="$sqlwhere" \
541a685,691
>         # update color to database?
>         sqlwhere="$GIS_OPT_column>$rangemin and $GIS_OPT_column<=$rangemax" 
>         if [ $GIS_FLAG_u -eq 1 ] ; then
>            echo "UPDATE $table SET GRASSRGB = '$themecolor' WHERE  $sqlwhere"\
>            | db.execute
>         fi
> 
543c693
<             where="$GIS_OPT_column>$rangemin and $GIS_OPT_column<=$rangemax" \
---
>             where="$sqlwhere" \
559a710,716
>         # update color to database?
>         sqlwhere="$GIS_OPT_column>$rangemin and $GIS_OPT_column<=$rangemax" 
>         if [ $GIS_FLAG_u -eq 1 ] ; then
>            echo "UPDATE $table SET GRASSRGB = '$themecolor' WHERE  $sqlwhere"\
>            | db.execute
>         fi
> 
561c718
<             where="$GIS_OPT_column>$rangemin and $GIS_OPT_column<=$rangemax" \
---
>             where="$sqlwhere" \
568a726,732
>         # update color to database?
>         sqlwhere="$GIS_OPT_column>$rangemin and $GIS_OPT_column<=$rangemax" 
>         if [ $GIS_FLAG_u -eq 1 ] ; then
>            echo "UPDATE $table SET GRASSRGB = '$themecolor' WHERE  $sqlwhere"\
>            | db.execute
>         fi
> 
570c734
<             where="$GIS_OPT_column>$rangemin and $GIS_OPT_column<=$rangemax" \
---
>             where="$sqlwhere" \
577a742,748
>         # update color to database?
>         sqlwhere="$GIS_OPT_column>$rangemin and $GIS_OPT_column<=$rangemax" 
>         if [ $GIS_FLAG_u -eq 1 ] ; then
>            echo "UPDATE $table SET GRASSRGB = '$themecolor' WHERE  $sqlwhere"\
>            | db.execute
>         fi
> 
579c750
<             where="$GIS_OPT_column>$rangemin and $GIS_OPT_column<=$rangemax" \
---
>             where="$sqlwhere" \
586a758,764
>         # update color to database?
>         sqlwhere="$GIS_OPT_column>$rangemin and $GIS_OPT_column<=$rangemax" 
>         if [ $GIS_FLAG_u -eq 1 ] ; then
>            echo "UPDATE $table SET GRASSRGB = '$themecolor' WHERE  $sqlwhere"\
>            | db.execute
>         fi
> 
588c766
<             where="$GIS_OPT_column>$rangemin and $GIS_OPT_column<=$rangemax" \
---
>             where="$sqlwhere" \


More information about the grass-dev mailing list