[GRASSLIST:3454] Re: ITCSpam: Complex SQL queries in d.vect (GRASS 5.7)

Radim Blazek blazek at itc.it
Thu May 20 12:26:50 EDT 2004


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




More information about the grass-user mailing list