[GRASS-user] Learning to use vector layers

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

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@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@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/

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@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@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@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/

Daniel Victoria wrote:

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.

v.reclass column= will reset the column which is used for the category
information. The column must be an integer type.

Hamish