[GRASS-user] v.net table layers

achim ak7 at jupiter.uni-freiburg.de
Mon Jun 29 11:28:56 EDT 2009


Hi,

when I run v.net, shouldn't I see two layers in the table-manager?
Wouldn't it be much more comfortable if it was possible to tell the 
modules to create a table?

I managed the problem with some difficulties. Its definitively not 
obvious how the workflow should be.

The metadata from aaa_temp are (No of dblinks 1)

  |   Type of Map:  vector (level: 2)
  |   Number of points:       218             Number of areas:      0 

  |   Number of lines:        134             Number of islands:    0 

  |   Number of boundaries:   0               Number of faces:      0
  |   Number of centroids:    0               Number of kernels:    0
  |
  |   Map is 3D:              No
  |   Number of dblinks:      1

Table-manager shows nothing!*

when I run v.category with report, I get:
v.category --overwrite input=aaa_temp at achim output=aaa_temp2 at achim 
option=report type=point layer=2
Layer/table: 1/aaa_temp
type       count        min        max
point          0          0          0
line         134          1        134
boundary       0          0          0
centroid       0          0          0
area           0          0          0
all          134          1        134

(I have to define an output-vector for report!???)               <-----?

So I add a layer for the nodes myself
v.category --overwrite input=aaa_temp at achim output=aaa_temp2 at achim 
type=point layer=2
Vector map <aaa_temp2> already exists and will be overwritten
Table <aaa_temp2> linked to vector map <aaa_temp2> does not exist
Processing features...
Copying attribute table(s)...
DBMI-SQLite driver error:
Error in sqlite3_prepare():select * from aaa_temp where 0 =
1
no such table: aaa_temp
Unable to open select cursor: 'select * from aaa_temp where 0 = 1'
Unable to copy table <aaa_temp2>
Failed to copy attribute table to output map
Building topology for vector map <aaa_temp2>...
Registering primitives...
352 primitives registered
2678 vertices registered
Building areas...
0 areas built
0 isles built
Attaching islands...
Attaching centroids...
Number of nodes: 218
Number of primitives: 352
Number of points: 218
Number of lines: 134
Number of boundaries: 0
Number of centroids: 0
Number of areas: 0
Number of isles: 0
v.category complete. 218 features modified.


v.category --overwrite input=aaa_temp2 at achim output=aaa_temp2 at achim 
option=report type=point layer=2
Layer/table: 1/aaa_temp2
type       count        min        max
point          0          0          0
line         134          1        134
boundary       0          0          0
centroid       0          0          0
area           0          0          0
all          134          1        134
Layer: 2
type       count        min        max
point        218          1        218
line           0          0          0
boundary       0          0          0
centroid       0          0          0
area           0          0          0
all          218          1        218

 >>When I add a new table I get:
v.db.addtable map=aaa_temp2 at achim 

Using vector map name as table name: aaa_temp2
ERROR: There is already a table linked to layer <1>

 >>Although the connection information gives (*):
v.db.connect -p map=aaa_temp2 at achim 

layer <1> table <aaa_temp2> in database </home/achim/grass/sqlite_db> 
through driver <sqlite> with key <cat>
Vector map <aaa_temp2 at achim> is connected by:

 >>So I delete the connection and build a new table:
v.db.addtable map=aaa_temp2 at achim 

Using vector map name as table name: aaa_temp2
Creating new DB connection based on default mapset settings...
Creating table with columns (cat integer)
The table <aaa_temp2> is now part of vector map <aaa_temp2 at achim> and 
may be deleted or overwritten by GRASS modules
Select privileges were granted on the table
Reading features...
Updating database...
134 categories read from vector map (layer 1)
134 categories read from vector map don't exist in selection from table
134 records updated/inserted (layer 1)
Current attribute table links:
Vector map <aaa_temp2 at achim> is connected by:
layer <1> table <aaa_temp2> in database </home/achim/grass/sqlite_db> 
through driver <sqlite> with key <cat>

 >>And another for layer 2:
v.db.addtable map=aaa_temp2 at achim layer=2 

Using vector map name extended by layer number as table name: aaa_temp2_2
Creating table with columns (cat integer)
The table <aaa_temp2_2> is now part of vector map <aaa_temp2 at achim> and 
may be deleted or overwritten by GRASS modules
Select privileges were granted on the table
Reading features...
Updating database...
layer <1> table <aaa_temp2> in database </home/achim/grass/sqlite_db> 
through driver <sqlite> with key <cat>
layer <2> table <aaa_temp2_2> in database </home/achim/grass/sqlite_db> 
through driver <sqlite> with key <cat>
218 categories read from vector map (layer 2)
218 categories read from vector map don't exist in selection from table
218 records updated/inserted (layer 2)
Current attribute table links:
Vector map <aaa_temp2 at achim> is connected by:

v.db.connect -p map=aaa_temp2 at achim 

layer <1> table <aaa_temp2> in database </home/achim/grass/sqlite_db> 
through driver <sqlite> with key <cat>
layer <2> table <aaa_temp2_2> in database </home/achim/grass/sqlite_db> 
through driver <sqlite> with key <cat>
Vector map <aaa_temp2 at achim> is connected by:

 >>So now I can see the information in the table manager. And now I can 
run network-tools, understanding what happens.

Comments welcomed,
Achim


More information about the grass-user mailing list