[R-sig-Geo] write.tgrass (spacetime) does not create init.txt

Edzer Pebesma edzer.pebesma at uni-muenster.de
Sun Jul 13 18:11:42 CEST 2014


spacetime::write.tgrass (as it is on github) now writes init.txt,
hopefully correct. I took examples from
https://www-pool.math.tu-berlin.de/~soeren/grass/ , and used file
precipitation_1950_2013_yearly_mm.tar.gz.

In this file, init.txt has quite different content from that you
describe below:

stds_type=strds
format=GTiff
temporal_type=absolute
semantic_type=mean
number_of_maps=63
north=75.5
south=25.25
east=75.5
west=-40.5

Does tgrass depend on knowing "relative_time_unit"?

I could write a function that write "years" when the number of days
between time stamps is 356 or 366, and act similarly for "months" (28,
29, 30 or 31), but this is somewhat messy of course, and things get
worse in case of daylight saving time and monthly data... Suggestions
welcome!

On 07/07/2014 06:57 PM, Sören Gebbert wrote:
> Hi,
> init.txt has the following content:
> 
> temporal_type=absolute
> semantic_type=mean
> relative_time_unit=years
> number_of_maps=61
> north=75.5
> south=25.25
> east=75.5
> west=-40.5
> 
> The spatial extent is ignored while importing, but the temporal type,
> semantic type (still a dummy in TGRASS) and the number of maps must be
> provided. The relative time unit is mandatory if the dataset has
> relative time, otherwise it can be left out.
> 
> I noticed that the reader expects always absolute time, is it possible
> to support relative time as well?
> 
> 
> Best regards
> Soeren
> 
> 2014-07-07 18:46 GMT+02:00 Edzer Pebesma <edzer.pebesma at uni-muenster.de>:
>> Thanks for the clear report, Veronica.
>>
>> Soeren (Cc:), do you know where we can find a description of the
>> requirements, or examples, of the init.txt file?
>>
>> On 07/07/2014 06:31 PM, Veronica Andreo wrote:
>>> Hi list
>>>
>>> I'm using R to run some processing over a spatio-temporal raster dataset
>>> coming from GRASS. The workflow is as follows:
>>>
>>> 1. Export all my images from GRASS with t.rast.export
>>> 2. Import them as a raster stack in R with read.tgrass
>>> 3. do the processing... which implies converting the rasterstack into a
>>> matrix, transposing and running dineof
>>> 4. create the rasterstack again, add the time with setZ
>>> 5. export with write.tgrass (which only seems to work for RasterStack and
>>> not for STFDF, i tried both ways)
>>> 6. and import to grass again...
>>>
>>> here is where I get the error since an init.txt file with the following
>>> information is needed but it's not created by write.tgrass...
>>>
>>> stds_type=strds
>>> format=GTiff
>>> temporal_type=absolute
>>> semantic_type=mean
>>> number_of_maps=
>>> north=
>>> south=
>>> east=
>>> west=
>>>
>>> There are of course some workarounds but it would be nice -and much more
>>> straightforward- that the function which is intended to provide interface
>>> between R and T-GRASS, already does the job itself :)
>>>
>>> Thanks much!
>>>
>>> Best,
>>> Vero
>>>
>>>       [[alternative HTML version deleted]]
>>>
>>> _______________________________________________
>>> R-sig-Geo mailing list
>>> R-sig-Geo at r-project.org
>>> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>>>
>>
>> --
>> Edzer Pebesma
>> Institute for Geoinformatics (ifgi), University of Münster
>> Heisenbergstraße 2, 48149 Münster, Germany. Phone: +49 251
>> 83 33081 http://ifgi.uni-muenster.de GPG key ID 0xAC227795
>>

-- 
Edzer Pebesma
Institute for Geoinformatics (ifgi), University of Münster
Heisenbergstraße 2, 48149 Münster, Germany. Phone: +49 251
83 33081 http://ifgi.uni-muenster.de GPG key ID 0xAC227795

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 490 bytes
Desc: OpenPGP digital signature
URL: <https://stat.ethz.ch/pipermail/r-sig-geo/attachments/20140713/ead03221/attachment.bin>


More information about the R-sig-Geo mailing list