[GRASS-user] RE: Problem querying layers other than '1' in gis.m
Michael Barton
michael.barton at asu.edu
Wed Sep 20 10:48:43 EDT 2006
You CAN link multiple tables to single vector objects. That is what layers
is all about. You need a separate CAT column for each table you link. Each
cat column is a "layer". It serves as a key to link the object with a record
in a table.
I don't know if v.what (used in gui vector querying) will query more than
layer one. There was some discussion about this awhile back and I can't
remember the outcome. There have been some other new changes to v.what that
will eventually go into 6.3. If layer support has been added, this will go
into 6.3 also.
Michael
__________________________________________
Michael Barton, Professor of Anthropology
School of Human Evolution & Social Change
Center for Social Dynamics & Complexity
Arizona State University
phone: 480-965-6213
fax: 480-965-7671
www: http://www.public.asu.edu/~cmbarton
> From: Moritz Lennert <mlennert at club.worldonline.be>
> Date: Tue, 19 Sep 2006 23:51:23 +0200 (CEST)
> To: "Patton, Eric" <epatton at nrcan.gc.ca>
> Cc: "'grassuser at grass.itc.it'" <grassuser at grass.itc.it>
> Subject: Re: [GRASS-user] RE: Problem querying layers other than '1' in gis.m
>
> 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