[GRASS-user] Question about the use of d.vect.thematic

Thomas Adams Thomas.Adams at noaa.gov
Fri Mar 19 12:00:39 EDT 2010


Hamish,

I made the code changes in the scripts (v.colors & d.vect.thematic), adding:

&& [ "$NCOLUMN_TYPE" != "REAL" ]


in the tests and that worked perfectly. Thanks for your help!!

Tom


Hamish wrote:
> Thomas wrote:
>   
>> I am trying to use d.vect.thematic to create a thematic map
>> where the vector polygons are filled with a color dependent
>> on an attribute value, swe, which is of type 'real'. I am
>> using sqlite as the db driver. The swe attribute was added
>> to my vector map using v.db.join, which worked fine. I can
>> query the map and see that the swe values are correct.
>>
>> However, when I use d.vect.thematic, I get the following
>> error:
>>
>> Column <swe> is of type <real> which is not numeric.
>>     
>
> probable bug in d.vect.thematic which only know integer and
> double precision.
>
>   
>> I don't understand; I guess there are subtle nuances with
>> these data type considerations which I don't yet appreciate.
>> When I created my sqlite db and table, should I have read-in
>> the data as a different type? If so, what?
>>     
>
>
> my advice if you have less than 30,000 area features is to use
> the new v.colors scripts to add a new GRASSRGB column with
> colors, then use 'd.vect -a'. Maybe it is possible to use
> d.vect's new zcolor= option, but that is more for points data
> than areas.
>
> of course v.colors suffers from the same lack of imagination
> and so will need an edit to work with "REAL" types.
>
> look for a line like this:
> (v.colors, but d.vect.thematic is similar)
>
> elif [ "$NCOLUMN_TYPE" != "INTEGER" ] && [ "$NCOLUMN_TYPE" != "DOUBLE PRECISION" ] ; then
>     g.message -e "Column <$GIS_OPT_COLUMN> is not numeric"
>     exit 1
> fi
>
>
> and try adding 
>
>   && [ "$NCOLUMN_TYPE" != "REAL" ]
>
> to the test. (edit to match local conditions)
>
>
> Hamish
>
>
>
>       
>   


-- 
Thomas E Adams
National Weather Service
Ohio River Forecast Center
1901 South State Route 134
Wilmington, OH 45177

EMAIL:	thomas.adams at noaa.gov

VOICE:	937-383-0528
FAX:	937-383-0033



More information about the grass-user mailing list