[GRASS-user] SQL Error using "v.color"

Micha Silver micha at arava.co.il
Sun Dec 19 15:33:22 EST 2010


On 19/12/2010 14:44, rvanderweide at worldbank.org wrote:
>
> Dear GRASS,
>
> I am using the December 19 (2010) build of GRASS 6.4 for Windows. I 
> have loaded a vector map (for a country with approx 20 province 
> boundaries) with an attribute table that contains a continuous 
> variable at the province level (name of column is `y2009'). Trying to 
> put the `y2009' variable on the map, i begin with defining the color 
> grading to be used by means of the following command:
>
> "GRASS 6.4> v.colors map=pse column=y2009 rgb_column=hc2 color=bcyr"
>
> Doing so I get the following error:
>
> "GRASS 6.4> v.colors map=pse column=y2009 rgb_column=hc2 color=bcyr
> Creating column <hc2> ...
> Scanning values ...
> Looking up colors ...
> Writing 16 colors ...
> DBMI-SQLite driver error:
> Error in sqlite3_prepare():
> near "SET": syntax error
>
> ERROR: Error while executing: 'UPDATE SET hc2 = '0:0:255' WHERE y2009 =
>        0.094713'
> ERROR: Processing SQL transaction
> rm: cannot remove `C://test/poverty/.tmp/636.0_vcol.sql': Permission 
> denied"
>
> Any idea what is creating the error -- or what i am doing wrong? Is 
> there a way to get around this/fix it?
>

I have a suggestion that might fix this problem. The v.colors script on 
line 209 uses the expression:

grep "^$GIS_OPT_LAYER;"

to isolate the TABLE name, and I think that the windows version of grep 
is confused by the semicolon ';'.


Please locate the script (should be under %GISBASE\scripts)  and open it 
in an editor. Then replace line 209 as follows:

(original)

TABLE=`v.db.connect -g map="$GIS_OPT_MAP" layer="$GIS_OPT_LAYER" fs=";" 
| grep "^$GIS_OPT_LAYER;" | cut -f2 -d';'`
(change to:)
TABLE=`v.db.connect -g map="$GIS_OPT_MAP" layer="$GIS_OPT_LAYER" fs=";" 
| grep "^$GIS_OPT_LAYER" | cut -f2 -d';'`
(just remove the ; from "^$GIS_OPT_LAYER" after grep)

Let us know if this works.

Regards,
Micha

> Many thanks in advance!
>
> Roy
>
>
> This mail was received via Mail-SeCure System.
>
>
> _______________________________________________
> grass-user mailing list
> grass-user at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/grass-user
>
> This mail was received via Mail-SeCure System.
>
>
>    

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/grass-user/attachments/20101219/895af616/attachment.html


More information about the grass-user mailing list