[GRASS-user] Interpolate a huge time-series with looping

Marcello Benigno benigno.marcello at gmail.com
Sun Feb 24 04:16:36 PST 2013


Richard

Thank you very much, is exactly what I was looking for.

Cheers

2013/2/22 Richard Chirgwin <rchirgwin at ozemail.com.au>

> Marcello -
>
> That's not so hard. In Grass-GIS 6.4 (the version I'm on ATM) the general
> form would be:
>
> for i in `echo "select distinct id from rainfall_time_series" | db.select
> -c`; do
> ## get year / month / day to use in output map name
> year=`echo "select year from rainfall_time_series where id=$i" | db.select
> -c`;
> month=`echo "select month from rainfall_time_series where id=$i" |
> db.select -c`;
> day=`echo "select day from rainfall_time_series where id=$i" | db.select
> -c`;
> outmap="map_"$year"_"$month"_"**$day";
> ## then run your command
> <command> input=rainfall_time_series output=$outmap;
> done
>
> That will step through each entry in the table.
>
> If you're on a different version, check the db.select command format - I
> think it changed in Grass-GIS 7.0?
>
> Cheers,
> Richard Chirgwin
>
> On 22/02/13 10:21 PM, grass-user-request at lists.**osgeo.org<grass-user-request at lists.osgeo.org>wrote:
>
>> Message: 3
>> Date: Thu, 21 Feb 2013 19:56:46 -0300
>> From: Marcello Benigno<benigno.marcello@**gmail.com<benigno.marcello at gmail.com>
>> >
>> To:grass-user at lists.osgeo.org
>> Subject: [GRASS-user] Interpolate a huge time-series with a looping
>> Message-ID:
>>         <CAKPVhYKNBGMsUE73JcXKcFB5uz-**Fe=vWUkr9WB0mHHD_C1pGuQ at mail.**
>> gmail.com <vWUkr9WB0mHHD_C1pGuQ at mail.gmail.com>>
>> Content-Type: text/plain; charset="iso-8859-1"
>>
>> In my dataset I have access to a table in PostgreSQL Database with this
>> structure:
>>
>> Table Name: rainfall_time_series
>>
>> Columns: id | year | month | day | value_mm | x | y | gauge_code
>>
>> Setting g.region to the Watershed limits, I need create for each day one
>> interpolated raster, representing the rainfall. This times-series is very
>> huge, has 17 years, my question is: is it possible to do this operation
>> with a looping? it is probably easier in R, but I'm newbie in this
>> software.
>>
>> Thanks in advance,
>> --
>> Marcello Benigno B. de Barros Filho
>> Prof. do Curso Superior de Tecnologia em Geoprocessamento - IFPB
>> Mestre em Ci?ncias Geod?sicas e Tecnologias da Geoinforma??o - UFPE
>> Doutorando em Tecnologia Ambiental e Recursos H?dricos - UFPE
>> http://profmarcello.blogspot.**com <http://profmarcello.blogspot.com>
>> http://about.me/marcello.**benigno <http://about.me/marcello.benigno>
>>
>
> ______________________________**_________________
> grass-user mailing list
> grass-user at lists.osgeo.org
> http://lists.osgeo.org/**mailman/listinfo/grass-user<http://lists.osgeo.org/mailman/listinfo/grass-user>
>



-- 
*Marcello Benigno B. de Barros Filho*
Prof. do Curso Superior de Tecnologia em Geoprocessamento - IFPB
Mestre em Ciências Geodésicas e Tecnologias da Geoinformação - UFPE
Doutorando em Tecnologia Ambiental e Recursos Hídricos - UFPE
http://profmarcello.blogspot.com
http://about.me/marcello.benigno
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/grass-user/attachments/20130224/d1b80863/attachment.html>


More information about the grass-user mailing list