<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:times new roman, new york, times, serif;font-size:12pt"><div style="font-family: times new roman,new york,times,serif; font-size: 12pt;">Hi Daniel,<br><br>Well, it depends on your database structure. If you have one table for each month:<br><br>SELECT t1.id, t1.east, t1.north, t1.rain,t2.rain,t3.rain FROM table1 as t1, table2 as t2, table3 as t3 WHERE...<br><br>Jaime<br><br><div style="font-family: times new roman,new york,times,serif; font-size: 12pt;">----- Mensaje original ----<br>De: Daniel Victoria <daniel.victoria@gmail.com><br>Para: Jaime Carrera <jaicarrerahdez@yahoo.com><br>CC: grass <grassuser@grass.itc.it><br>Enviado: lunes, 26 de marzo, 2007 16:36:23<br>Asunto: Re: [GRASS-user] Learning to use vector layers<br><br><div>Yea, that could do it also, just have to figure out how to perform<br>different queries for each column so I'd have average
January on col<br>1 and avg February on two and so on. Probably a bunch of table<br>updates?<br><br>Thanks<br>Daniel<br><br>On 3/26/07, Jaime Carrera <jaicarrerahdez@yahoo.com> wrote:<br>> Hi Daniel,<br>><br>> You could also generate a table like this:<br>><br>> id|easting|northing|9001|9002|9003|...|9012|9101|...<br>><br>> Then you have your data in one table which can be<br>> linked to the vector file. Such a table can be<br>> generated from other tables using SQL commands.<br>><br>> HTH<br>><br>> Jaime<br>><br>><br>> --- Daniel Victoria <daniel.victoria@gmail.com><br>> escribió:<br>><br>> > Hi all,<br>> ><br>> > I have a vector problem and I think it might be a<br>> > job for vector layers.<br>> > I have a postgresql table with daily meteorological<br>> > station data (~10<br>> > years, 300 stations) and I'd like to get average<br>> > monthly
precipitation<br>> > for each station.<br>> > That I can easily do with a SQL query, generating a<br>> > view and attaching<br>> > the view to a vector file where the CAT column is<br>> > the station number.<br>> > The problem is, I can only attach one SQL view at a<br>> > time since the<br>> > vector file has only one category (from what I read,<br>> > it's one category<br>> > per layer connection correct?)<br>> ><br>> > So, I though about some options:<br>> > 1) either generate 1 vector file for each month -<br>> > simple but then I<br>> > don't learn about layers<br>> > 2) keep changing the database connection for each<br>> > month - works but<br>> > seems kind of improvisation<br>> > 3) Use layers, one layer for each month. I'd have<br>> > the advantage of not<br>> > having categories for stations with no data for a<br>> > specific month
for<br>> > example and also, I'd learn about layers<br>> ><br>> > So, the proper questions:<br>> > Does this sounds like a job for vector layers?<br>> > How do I add categories to a vector file but, the<br>> > categories should<br>> > come from a column in a SQL view? From what I read,<br>> > v.category can<br>> > only add sequential cats and I'd like the cats to be<br>> > the station<br>> > number.<br>> ><br>> > Cheers and sorry for the long email<br>> > Daniel<br>> ><br>> > _______________________________________________<br>> > grassuser mailing list<br>> > grassuser@grass.itc.it<br>> > <a target="_blank" href="http://grass.itc.it/mailman/listinfo/grassuser">http://grass.itc.it/mailman/listinfo/grassuser</a><br>> ><br>><br>><br>> __________________________________________________<br>> Correo Yahoo!<br>> Espacio para todos tus mensajes,
antivirus y antispam ¡gratis!<br>> Regístrate ya - <a target="_blank" href="http://correo.espanol.yahoo.com/">http://correo.espanol.yahoo.com/</a><br>><br></div></div><br></div></div><br>__________________________________________________<br>Correo Yahoo!<br>Espacio para todos tus mensajes, antivirus y antispam ¡gratis! <br>Regístrate ya - http://correo.espanol.yahoo.com/ </body></html>