[GRASS-dev] drop / link table

Hi,

First of all, happy new year. For me the year starts with some trouble dealing with attribute tables. Below two things I can’t figure out. This is all in GRASS 7.0 on Linux

(A)

I am trying to link a second table to layer two of a vector layer. For example:

v.db.addtable map=A table=A2 layer=2 columns=‘bio1 INTEGER,bio2 INTEGER’

This creates, as expected, a table with a cat column (at least, in the table attribute manager, the tables shows with a cat column with values) and two empty columns bio1 and bio2

Now I want to populate the bio1 and bio2 columns using v.what.rast:

v.what.rast map=A Layer=2 raster=bio_1@climate column=bio1
v.what.rast map=A Layer=2 raster=bio_2@climate column=bio2

I am getting the following error message:

Reading features from vector map…
100%
WARNING: 316 points without category were skipped
Update vector attributes…
WARNING: No record for category 0 in table
100%
v.what.rast complete. 0 records updated.

But the table A2, linked to layer 2, does have category values. Or do I misunderstand how this works?

(B)

I wanted to drop the layer from a vector map. In the Table Attribute manager, you can remove a layer without dropping (deleting) the table (the default). But how do I do this on the command line? Using the d.db.droptable removes the layer by dropping the table (or it removes the layer and drops the table, not sure what happens internally).

Cheers,

Paulo

In addition to my previous email: in the help of v.db.addtable, there is the example:

g.copy vect=roadsmajor,myroads

v.db.addtable myroads columns=“slope double precision”

However, when I try that, I am getting the following message:

“ERROR: There is already a table linked to layer <1>”

···

On Tue, Jan 1, 2013 at 8:14 PM, Paulo van Breugel <p.vanbreugel@gmail.com> wrote:

Hi,

First of all, happy new year. For me the year starts with some trouble dealing with attribute tables. Below two things I can’t figure out. This is all in GRASS 7.0 on Linux

(A)

I am trying to link a second table to layer two of a vector layer. For example:

v.db.addtable map=A table=A2 layer=2 columns=‘bio1 INTEGER,bio2 INTEGER’

This creates, as expected, a table with a cat column (at least, in the table attribute manager, the tables shows with a cat column with values) and two empty columns bio1 and bio2

Now I want to populate the bio1 and bio2 columns using v.what.rast:

v.what.rast map=A Layer=2 raster=bio_1@climate column=bio1
v.what.rast map=A Layer=2 raster=bio_2@climate column=bio2

I am getting the following error message:

Reading features from vector map…
100%
WARNING: 316 points without category were skipped
Update vector attributes…
WARNING: No record for category 0 in table
100%
v.what.rast complete. 0 records updated.

But the table A2, linked to layer 2, does have category values. Or do I misunderstand how this works?

(B)

I wanted to drop the layer from a vector map. In the Table Attribute manager, you can remove a layer without dropping (deleting) the table (the default). But how do I do this on the command line? Using the d.db.droptable removes the layer by dropping the table (or it removes the layer and drops the table, not sure what happens internally).

Cheers,

Paulo