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

Moritz Lennert mlennert at club.worldonline.be
Tue Sep 19 17:51:23 EDT 2006


On Tue, September 19, 2006 21:34, Patton, Eric wrote:
> 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".

Are you sure that you are using the layers correctly ? I've that the same
head scratching which lead to this thread:
http://grass.itc.it/pipermail/grass5/2005-September/019592.html

The way I understand it, you cannot link the same features to two
different tables. You would have to duplicate your points from layer 1 to
layer 2 to be able to link them to another table.

Would be great to be able to link to several tables. Can't you just create
a view which combines the two tables and link your map to that ?

Moritz




More information about the grass-user mailing list