[GRASS-user] Re: using v.colors- suggestion of using a sqlite suggestion

Luisa Peña luisapena1979 at gmail.com
Wed Nov 17 10:21:46 EST 2010


Hello achim
1- I converted from raster to vector (r.to.vect)
r.to.vect -v input=teste01_LULC at Regional output=vector01 feature=area

Extracting areas...
Building topology for vector map <vector01>...
Registering primitives...
833 primitives registered
4624 vertices registered
Building areas...
334 areas built
163 isles built
Attaching islands...
Attaching centroids...
Number of nodes: 662
Number of primitives: 833
Number of points: 0
Number of lines: 0
Number of boundaries: 499
Number of centroids: 334
Number of areas: 334
Number of isles: 163
r.to.vect complete.

2- When I select a designated area i get this:
East: 629238.662505
North: 9331859.599043
Map: vector01
Mapset: Regional
Type: Area
Sq Meters: 1132124355.009
Hectares: 113212.436
Acres: 279754.021
Sq Miles: 437.1157
Layer: 1
Category: 5
Driver: dbf
Database: C:\DWEISdata/Brazil/Regional/dbf/
Table: vector01
Key column: cat
cat : 5
label :
(CAT IS the value of my previous raster)

3- When i do:
v.db.connect map=vector01 at Regional table=vector01 driver=sqlite
I get the following error:
ERROR: Use -o to overwrite existing link for layer <1>
THis will mean that it will overwrite existing table right?

I tried with -o and I got the error:
DBMI-SQLite driver error:
Unable to open database: unable to open database file
Unable to open database <$GISDBASE/$LOCATION_NAME/$MAPSET/dbf/> by driver
<sqlite>
Unable open database <$GISDBASE/$LOCATION_NAME/$MAPSET/dbf/> by driver
<sqlite>
ERROR: Table <vector01> does not exist in database
<$GISDBASE/$LOCATION_NAME/$MAPSET/dbf/>
So I'm not able to do what you suggest

Any other suggestion?

2010/11/16 Achim Kisseler <ak7 at jupiter.uni-freiburg.de>

> Hi,
>
> you should not loose the information, because the table you create consists
> of a column "cat" by default containing the cats.
>
> Does this do the job?
>
> Achim
>
> Am 16.11.2010 09:46, schrieb Luisa Peña:
>
>> Hi Achim
>> Well, the thing is, if I add a table to my vector, I will loose all the
>> information that is already available in my vector (since it's a
>> conversion from a Classification raster I have a cat value for each
>> area). Right?
>>
>> 2010/11/15 Achim Kisseler <ak7 at jupiter.uni-freiburg.de
>> <mailto:ak7 at jupiter.uni-freiburg.de>>
>>
>>
>>
>>
>>    Am 15.11.2010 16:41, schrieb Luisa Peña:
>>
>>        In this email,
>>
>> http://lists.osgeo.org/pipermail/grass-user/2010-November/058644.html,
>>        you suggested me to use sqlite as database. I'm willing to try
>>        that. How
>>        can I do that with a vector created from r.to.vect with categories
>>        values in cat column
>>
>>
>>    Hi Luisa,
>>
>>    first create an sqlite-database, second take the vector file and add
>>    an table to it
>>    (http://grass.osgeo.org/gdp/html_grass64/v.db.addtable.html:
>>    --%<--
>>    DESCRIPTION
>>    v.db.addtable creates and adds a new attribute table to a given
>>    vector map. It links the table to the specified layer of the vector
>>    map. If the vector map is not yet linked to any table, new a
>>    database link is established based on the MAPSET database settings
>>    (see db.connect).
>>    --%<--).
>>    Is that what you are looking for?
>>
>>    Regards,
>>    Achim
>>
>>
>>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/grass-user/attachments/20101117/3babefd5/attachment.html


More information about the grass-user mailing list