[GRASSLIST:10156] Re: v.to.db option=query: issue with 2 layers and multiple categories

Maciek Sieczka werchowyna at epf.pl
Sun Feb 5 13:00:32 EST 2006


Radim,

On Fri, 3 Feb 2006 19:17:42 +0100
Radim Blazek <radim.blazek at gmail.com> wrote:

> On 2/3/06, Maciek Sieczka <werchowyna at epf.pl> wrote:
> > On Thu, 2 Feb 2006 09:41:10 +0100
> > Radim Blazek <radim.blazek at gmail.com> wrote:
> >
> > > If you use qcolumn=height v.to.db queries the database for this
> > > point with select height from testing_pt_nodupl2_1 where cat=1 or
> > > cat=2 The result is 2 rows (100.5 twice). It is impossible to
> > > upload 2 values into one row in layer 2. If you have more cats in
> > > queried layer on the same geometry it is necessary to use an
> > > aggregate function, for example qcolumn=avg(height).
> > >
> > > Does it work?
> >
> > However, there are _also_ two categories for the same geometry in
> > layer 2 (10,11). I mean - I understand I couldn't upload 2 values
> > into one "row". But since in this particular case in both layer 1
> > and 2 there are two "rows", isn't it somehow different? Just
> > wondering.
> 
> If it is not uploaded to both rows  in layer 2 (10,11) then it is a
> bug.

It isn't uploaded indeed. I doublechecked on another simple example
just to make sure. The situation was as follows:

- there are categories 1,2 in layer 1; the attribute name is
"elevation"; for category 1 elevation=100, for cat 2 elevation=200.

- there are categories 10,11 in layer2; the attribute name is
"elevation2"

- trying to populate "elevation2" in layer 2 (cat 10,11) with
"elevation" from layer 1 (cat 1,2) results in an error - the
"elevation2" for cat 10,11 is set to NULL:

v.to.db map=nowy_pt_nodup type=point layer=2 qlayer=1 option=query
column=elevation2 qcolumn=elevation Reading data trom the map ...  100%
Querying database ... WARNING: Multiple query results, output value set
to NULL (category 3) 100%
WARNING: Multiple query results, output value set to NULL (category 2)
Updating database ...  100%
4 categories read from map
4 records selected from table
4 categories read from map exist in selection from table
0 categories read from map don't exist in selection from table
4 records updated/inserted
0 update/insert errors

So this is a bug? Fixable?

Maciek

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




More information about the grass-user mailing list