[GRASS-user] SQL and GRASS

Richard Chirgwin rchirgwin at ozemail.com.au
Wed Mar 10 22:29:30 EST 2010


> Message: 6
> Date: Sun, 7 Mar 2010 06:02:51 -0800 (PST)
> From: Gary Nobles <garynobles at yahoo.com>
> Subject: [GRASS-user] SQL and GRASS
> To: grass-user at lists.osgeo.org
> Message-ID: <1267970571671-4690410.post at n2.nabble.com>
> Content-Type: text/plain; charset=us-ascii
>
>
> GRASS is connected to a MySQL data base
>
> I want to select polygons which are not 0
> so do I do:
>
> d.vect  SiteGrid3 where "SquareNumber<>0 "
> or
> v.db.select map=SiteGrid3 column=square_no where=<>0
>
>
> I have a second non spatial table described below(right)
>
> grass SiteGrid3  (one)            Pottery table (many)
> |cat|SquareNumber|            |SquareNumber|Type|
> |1   |1                 |            |1                  |mug |
> |2   |2                 |            |1                  |mug |
> |3   |3                 |            |1                  |mug |
> it continues...
>
>
> so now I want to select the square number but be able to use v.what to
> return the amount of pottery.
>
> Any ideas? This is easy in sql but I want to show it in GRASS
>
> Thanks
>
> Gary
>   

Gary,

Easy.

d.vect SiteGrid3 where="SquareNumber<>0"
or
v.db.select map=SiteGrid3 column=square_no where="square_no<>0"

In Grass-GIS, "where" statements are generally followed by the equals 
sign, then the statement.

Richard C
>
>   



More information about the grass-user mailing list