[GRASSLIST:10521] d.what.vect issue with multiple layers

Is there a way to specify the layer (table) that comes up to
interactively edit attributes in d.what.vect? In my case I have 2
layers (ie tables) associated with a particular vector map. If I
display the vector map with d.vect 'map_name' then run d.what.vect -e,
the form that comes up only has the first layer (table) in it. I
would like to edit layer 2, by clicking on the polygon in the vector
map.

Is this possible with d.what.vect?

Thanks,

Kirk

On Wed, 22 Feb 2006 08:33:24 -0600
"Kirk R. Wythers" <kwythers@umn.edu> wrote:

Is there a way to specify the layer (table) that comes up to
interactively edit attributes in d.what.vect? In my case I have 2
layers (ie tables) associated with a particular vector map. If I
display the vector map with d.vect 'map_name' then run d.what.vect -e,
the form that comes up only has the first layer (table) in it. I
would like to edit layer 2, by clicking on the polygon in the vector
map.

Is this possible with d.what.vect?

For me, d.vect -e on a 2 layer vector file works. In the upper part of
the window there is "Layer 1", in the lowe part there is "Layer 2".

Maciek

--------------------
W polskim Internecie s? setki milion?w stron. My przekazujemy Tobie tylko najlepsze z nich!
http://katalog.panoramainternetu.pl/

On Thu, 23 Feb 2006 08:41:38 -0600
"Kirk R. Wythers" <kwythers@umn.edu> wrote:

On Feb 22, 2006, at 1:54 PM, Maciek Sieczka wrote:

> For me, d.vect -e on a 2 layer vector file works. In the upper part
> of the window there is "Layer 1", in the lowe part there is "Layer
> 2".

Thanks for the reply Maciek. For me, I don't seem to have the lower
part that you do. I would like to figure this out however. Could it
be related to the database? I am using postgresql for attribute
management. Are you using sqlite? Here is a description of my
situation:

GRASS 6.1.cvs (minnesota_utm):~ > db.tables -p
public.geometry_columns
public.spatial_ref_sys
information_schema.sql_features
information_schema.sql_implementation_info
information_schema.sql_languages
information_schema.sql_packages
information_schema.sql_sizing
information_schema.sql_sizing_profiles
public.t61v1_working
public.t61v1_working_2

The two tables I am trying to work with are:

public.t61v1_working
public.t61v1_working_2

Are you sure they are connected with your vector file?

How many dblinks does the 'v.info your_vector_file' report?

Provided there are 2 dblinks indeed, what does 'v.info -c layer=1
your_vector_file' and 'v.info -c layer=2 your_vector_file' say?

I added the second table with db.addtable and I can view and edit it
fine is pgadmin3. Does any of this make sense to you Maciek? Is it
similar to how your system is set up?

I've never used postgres. Only DBF and SQLITE. And I'm not an sql
expert. So I might be of not much help. But try this procedure (I
couldn't think of anything else, but it is reproducable and should do)
to make sure Grass is able to create and query a vector with 2 layers
using postgres. For both SQLITE and DBF it works as expected:

$ v.digit map=nowa -n

# add 1 column to the table; draw 1 line; input attribute; exit

$ v.to.points input=nowa type=line output=nowa_pt llayer=1 dmax=100

# it will automatically create 'nowa_pt' with 2 dblinks

$ d.erase; d.vect nowa_pt; d.what.vect -e

# an edit window with layer 1 and layer 2 properties pops up

Is it the same in your postgres case?

Maciek

--------------------
W polskim Internecie s? setki milion?w stron. My przekazujemy Tobie tylko najlepsze z nich!
http://katalog.panoramainternetu.pl/

Maciek and Radim,

Here is a more info on this layer question
On Feb 23, 2006, at 1:09 PM, Maciek Sieczka wrote:

Are you sure they are connected with your vector file?

How many dblinks does the 'v.info your_vector_file' report?

Provided there are 2 dblinks indeed, what does 'v.info -c layer=1
your_vector_file' and 'v.info -c layer=2 your_vector_file' say?

I have a vector file (linked to layer 1) with the name t61nr9w_tvol, v.info gives:

GRASS 6.1.cvs (minnesota_utm):~ > v.info -c t61nr9w_tvol layer=1
Displaying column types/names for database connection of layer 1:
INTEGER|cat
INTEGER|a_cat
DOUBLE PRECISION|a_area
DOUBLE PRECISION|a_perimeter
DOUBLE PRECISION|a_pls_fort_
DOUBLE PRECISION|a_pls_fort_i
INTEGER|a_coun
INTEGER|a_town
INTEGER|a_rdir
INTEGER|a_rang
INTEGER|a_sect
INTEGER|a_fort
INTEGER|a_glot
INTEGER|a_parc
CHARACTER|a_fort_desc
DOUBLE PRECISION|a_glotmatch
INTEGER|b_cat

I used v.db.addtable to add 6 additional layers, v.info on each gives the equivalent of:

GRASS 6.1.cvs (minnesota_utm):~ > v.info -c t61nr9w_tvol layer=2
Displaying column types/names for database connection of layer 2:
INTEGER|cat
INTEGER|cords
INTEGER|mbm
INTEGER|poles
INTEGER|posts

depending on layer specified.

This tells me that the layers are connected. Correct?

I've never used postgres. Only DBF and SQLITE. And I'm not an sql
expert. So I might be of not much help. But try this procedure (I
couldn't think of anything else, but it is reproducable and should do)
to make sure Grass is able to create and query a vector with 2 layers
using postgres. For both SQLITE and DBF it works as expected:

$ v.digit map=nowa -n

# add 1 column to the table; draw 1 line; input attribute; exit

$ v.to.points input=nowa type=line output=nowa_pt llayer=1 dmax=100

# it will automatically create 'nowa_pt' with 2 dblinks

$ d.erase; d.vect nowa_pt; d.what.vect -e

# an edit window with layer 1 and layer 2 properties pops up

If I follow these directions, the edit window comes up showing layer one only. Radim, I know you suggested v.category in a previous post. Sorry to be so dense on this, but reading the man page for v.category, I'm not sure what to do there.

the report option gives the same infor for both layer 1 and layer2. This implies a problem to me:

GRASS 6.1.cvs (minnesota_utm):~ > v.category input=t61nr9w_tvol option=report layer=1
LAYER/TABLE 1/t61nr9w_tvol:
type count min max
point 0 0 0
line 0 0 0
boundary 0 0 0
centroid 686 1 686
area 0 0 0
all 686 1 686
GRASS 6.1.cvs (minnesota_utm):~ > v.category input=t61nr9w_tvol option=report layer=2
LAYER/TABLE 1/t61nr9w_tvol:
type count min max
point 0 0 0
line 0 0 0
boundary 0 0 0
centroid 686 1 686
area 0 0 0
all 686 1 686

Do I need to add a new category here?

Thanks

Kirk

Is it the same in your postgres case?

Maciek

--------------------
W polskim Internecie s? setki milion?w stron. My przekazujemy Tobie tylko najlepsze z nich!
http://katalog.panoramainternetu.pl/