[GRASS-user] RE: Problem querying layers other than '1' in gis.m

Patton, Eric epatton at nrcan.gc.ca
Tue Sep 19 15:34:16 EDT 2006


I'm having trouble querying layer two on my vector map in gis.m. I can
query both the columns and data of layer one without problems. Maybe I
misunderstand the use of the tool. Are we supposed to be able to query
multiple layers on gis.m? If not, disregard the following. If so, read
on.

I attached a second table to a vector point map on layer 2 like so:

v.db.connect map=Station_46_Interp driver=sqlite
database=/home/epatton/Projects/Cheticamp/PERMANENT/databases/Cheticamp.
db table=Benthos key=Timestamp layer=2 

And v.db.connect shows that two tables are now connected:

v.db.connect -g map=Station_46_Interp driver=sqlite
database=/home/epatton/Projects/Cheticamp/PERMANENT/databases/Cheticamp.
db table=Benthos key=Timestamp layer=2 

1 Station_46_Interp cat
/home/epatton/Projects/Cheticamp/PERMANENT/databases/Cheticamp.db sqlite
2 Benthos Timestamp
/home/epatton/Projects/Cheticamp/PERMANENT/databases/Cheticamp.db sqlite

I can query layer 1 in gis.m by showing the table columns using the
'show columns' button:

Displaying column types/names for database connection of layer 1:
INTEGER|cat
INTEGER|Timestamp
DOUBLE PRECISION|Easting
DOUBLE PRECISION|Northing

And similarly for layer 2:

Displaying column types/names for database connection of layer 2:
INTEGER|Station_ID
INTEGER|Depth_m
INTEGER|Latitude
INTEGER|Longitude
INTEGER|Julian_Day
INTEGER|UTM_time
INTEGER|Sediment_type
INTEGER|Description
INTEGER|Easting
INTEGER|Northing
INTEGER|Timestamp

However, the 'show attribute data' button only works for layer 1, not
layer 2:

Command output pasted from gis.m Output window:

db.select table=Station_46_Interp
database=/home/epatton/Projects/Cheticamp/PERMANENT/databases/Cheticamp.
db driver=sqlite 2

The table connected on layer 2 is Benthos, not Station_46_Interp.
It look like the value "2" is simply appended after the driver
parameter, giving the understandable error from gis.m of " Sorry <2> is
not a valid option".

~ Eric.





More information about the grass-user mailing list