Hello, Is there any way to actually specify an SQL statement in d.vect that would be executed to produce the cat ids for display? The problem I am facing is that in order to display labels and lines, I need to execute an SQL statement with an inner join, and d.vect does not seem to be doing this for me.
This is the output from v.db.connect -p bntl_shp:
Vector map <bntl_shp> is connected by:
field <1> table <bntl_shp_1> in database <host=localhost,dbname=bc_alb,user=postgres> through driver <pg> with key <cat>
field <2> table <bntl_shp_2> in database <host=localhost,dbname=bc_alb,user=postgres> through driver <pg> with key <cat>
field <3> table <bntl_shp_3> in database <host=localhost,dbname=bc_alb,user=postgres> through driver <pg> with key <cat>
I am displaying my lines through d.vect and a where clause on field 1. I need to display labels from field 3. However in order to do that, i need to join query results from field 1 with field 3.
The only approach I can see is that I create a new column in table bntl_shp_1 that would store my attr labels in that column rather then storing the attr labels in bntl_shp_3.
Craig
On Thursday 20 May 2004 17:26, Funkmeister wrote:
Hello, Is there any way to actually specify an SQL statement in d.vect
that would be executed to produce the cat ids for display? The problem
I am facing is that in order to display labels and lines, I need to
execute an SQL statement with an inner join, and d.vect does not seem
to be doing this for me.
This is the output from v.db.connect -p bntl_shp:
Vector map <bntl_shp> is connected by:
field <1> table <bntl_shp_1> in database
<host=localhost,dbname=bc_alb,user=postgres> through driver <pg> with
key <cat>
field <2> table <bntl_shp_2> in database
<host=localhost,dbname=bc_alb,user=postgres> through driver <pg> with
key <cat>
field <3> table <bntl_shp_3> in database
<host=localhost,dbname=bc_alb,user=postgres> through driver <pg> with
key <cat>
I am displaying my lines through d.vect and a where clause on field 1.
I need to display labels from field 3. However in order to do that, i
need to join query results from field 1 with field 3.
The only approach I can see is that I create a new column in table
bntl_shp_1 that would store my attr labels in that column rather then
storing the attr labels in bntl_shp_3.
I guess that bntl_shp was imported by v.in.ogr and it contains features from
3 shapefiles? Then if you don't have overlapping areas, each feature is linked
only to one from those 3 tables.
If you have realy links to more tables for individual features,
d.vect field=1 lfield=3 should work.
Radim
Thanks Radim, I suspect that you are correct in that there was a shp file for the lines and a shp for the labels.
I tried your approach but it did not work as expected because (I think) the col in the where clause does not exist in both tables. So in order for this to work I would need to be able to specify how to join the query results from the two tables together.
I ended up creating new columns in 1 table and updating the table with the relevant data. Now it works.
Thanks
On 20-May-04, at 10:26 AM, Radim Blazek wrote:
On Thursday 20 May 2004 17:26, Funkmeister wrote:
<snip>
The only approach I can see is that I create a new column in table
bntl_shp_1 that would store my attr labels in that column rather then
storing the attr labels in bntl_shp_3.
<snip>
I guess that bntl_shp was imported by v.in.ogr and it contains features from
3 shapefiles? Then if you don't have overlapping areas, each feature is linked
only to one from those 3 tables.
If you have realy links to more tables for individual features,
d.vect field=1 lfield=3 should work.
Radim