[GRASS-user] Multiple to one question

Moritz Lennert mlennert at club.worldonline.be
Wed Apr 15 19:29:14 EDT 2009


On 16/04/09 01:00, Adam Dershowitz, Ph.D., P.E. wrote:
> This is somewhat a followup to my prior post and somewhat a new, but 
> related problem.
> 
> I ended up doing what I had proposed, which is I have a table that has 
> each sample value and location:
> 
> Location    Value cat
> a    3.1    1
> b    2.1    2
> a    1.1    3
> c    4.1    4
> 
> etc.
> 
> Then I have linked each vector point to multiple categories by using
> v.edit map=foo layer=1 where="cat==1" type=point tool=catadd cat=3  (for 
> example)  So then I have an vector point that has a cat of both 1 and 
> 3.  So far so good.
> If I then try to display Label vectors using Value for the attribute, it 
> works fine.  Each value is displayed separated by a slash "/".
> 
> The problem is if I try to use a SQL query, it is not working as 
> expected.  I think that what it is doing is just applying the test to 
> the first value, then showing or hiding the other values based on that 
> first test (although I am not 100% sure that is what it is doing).
> So, for example, if I were to do Use SQL query: Value > 2.0 it would 
> draw a label like this:  3.1/1.1  And if I were to use a query of Value 
> < 2.0 it would not display anything.  What I want it to do is to show 
> all values that are actually greater than 2. and not to display the others.
> 
> Any suggestions of what it is doing, or what I can do about it?

Create a view in your database containing the results of your query, 
including cat values, and link your map to that view, instead of the 
table. If you want to change the content, just drop the view and 
recreate it with a different query. You can do all this either directly 
in sqlite, or via the db.execute GRASS module.

Moritz


More information about the grass-user mailing list