[GRASS-user] Learning to use vector layers

Jaime Carrera jaicarrerahdez at yahoo.com
Mon Mar 26 10:58:19 EDT 2007


Hi Daniel,

Well, it depends on your database structure. If you have one table for each month:

SELECT t1.id, t1.east, t1.north, t1.rain,t2.rain,t3.rain FROM table1 as t1, table2 as t2, table3 as t3 WHERE...

Jaime

----- Mensaje original ----
De: Daniel Victoria <daniel.victoria at gmail.com>
Para: Jaime Carrera <jaicarrerahdez at yahoo.com>
CC: grass <grassuser at grass.itc.it>
Enviado: lunes, 26 de marzo, 2007 16:36:23
Asunto: Re: [GRASS-user] Learning to use vector layers

Yea, that could do it also, just have to figure out how to perform
different queries for each column so I'd have average January on  col
1 and avg February on two and so on. Probably a bunch of table
updates?

Thanks
Daniel

On 3/26/07, Jaime Carrera <jaicarrerahdez at yahoo.com> wrote:
> Hi Daniel,
>
> You could also generate a table like this:
>
> id|easting|northing|9001|9002|9003|...|9012|9101|...
>
> Then you have your data in one table which can be
> linked to the vector file. Such a table can be
> generated from other tables using SQL commands.
>
> HTH
>
> Jaime
>
>
> --- Daniel Victoria <daniel.victoria at gmail.com>
> escribió:
>
> > Hi all,
> >
> > I have a vector problem and I think it might be a
> > job for vector layers.
> > I have a postgresql table with daily meteorological
> > station data (~10
> > years, 300 stations) and I'd like to get average
> > monthly precipitation
> > for each station.
> > That I can easily do with a SQL query, generating a
> > view and attaching
> > the view to a vector file where the CAT column is
> > the station number.
> > The problem is, I can only attach one SQL view at a
> > time since the
> > vector file has only one category (from what I read,
> > it's one category
> > per layer connection correct?)
> >
> > So, I though about some options:
> > 1) either generate 1 vector file for each month -
> > simple but then I
> > don't learn about layers
> > 2) keep changing the database connection for each
> > month - works but
> > seems kind of improvisation
> > 3) Use layers, one layer for each month. I'd have
> > the advantage of not
> > having categories for stations with no data for a
> > specific month for
> > example and also, I'd learn about layers
> >
> > So, the proper questions:
> > Does this sounds like a job for vector layers?
> > How do I add categories to a vector file but, the
> > categories should
> > come from a column in a SQL view? >From what I read,
> > v.category can
> > only add sequential cats and I'd like the cats to be
> > the station
> > number.
> >
> > Cheers and sorry for the long email
> > Daniel
> >
> > _______________________________________________
> > grassuser mailing list
> > grassuser at grass.itc.it
> > http://grass.itc.it/mailman/listinfo/grassuser
> >
>
>
> __________________________________________________
> Correo Yahoo!
> Espacio para todos tus mensajes, antivirus y antispam ¡gratis!
> Regístrate ya - http://correo.espanol.yahoo.com/
>






__________________________________________________
Correo Yahoo!
Espacio para todos tus mensajes, antivirus y antispam ¡gratis! 
Regístrate ya - http://correo.espanol.yahoo.com/ 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/grass-user/attachments/20070326/8f0a9740/attachment.html


More information about the grass-user mailing list