Closed janzandr closed 1 week ago
@ffilipponi, please provide a small raster file created by R-cran terra package for testing.
@janzandr , please find two small samples of raster time series exported from R-cran terra package in GeoTIFF format, complemented with '.aux.json' metadata containing time dimension information. R-cran terra package exports by default '.aux.json' file when the terra rast object to be exported has a defined time dimension (or other attributes).
Unevenly_spaced_time_series_R-cran_terra.zip
Thanks for considering the new feature request
Thanks. Looks like the format supports different units (i.e. timestep). For now I will implement the "days" and "seconds" unit used in your examples:
If you need additional units, please provide some additional datasets (one for each unit).
Done
Thanks for implementing the feature. Supported timesteps in R-cran terra package are: 'seconds' (POSIXlt), 'days' (Date), 'yearmonths' (decimal years), 'years', 'months'. When the timestep is not defined, it will be exported as 'raw'. From my point of view, it might be sufficient to have only 'days' and 'seconds' supported in EnMAP-Box. I forgot to specify that '.aux.json' file generated from R-cran terra package may contain various keys, depending on the properties associated to the object of class 'rast' that is exported. As a consequence, the keys 'time' and 'timestep' required to set time axis in EnMAP-Box may not always be defined in the '.aux.json' file. This needs an additional check to be integrated, in order to read time information only if it is defined in the '.aux.json' file. I suggest to modify line 787 in file 'rasterreader.py' as follows:
if self.terraMetadata is not None:
if 'time' in self.terraMetadata.keys() and 'timestep' in self.terraMetadata.keys():
Requested by @ffilipponi in #552 ...