The TimeShift operator allows retrieving data temporally relative to the actual QueryRectangle. It shifts the query rectangle by a given amount of time and modifies the result data accordingly. Users have two options for specifying the time shift:
TimeShift
QueryRectangle
The output is either a stream of raster data or a stream of vector data depending on the input.
An example usage scenario is to compare the current time with the previous time of the same raster data. For instance, a raster source outputs monthly data aggregates of mean temperatures. If you want to compute the difference between the current month and the previous month, you can use the TimeShift operator. You will have two workflows. One is the unmodified temperature raster source. The other is the same source, shifted by one month. Then, you can use both workflows as sources of an Expression operator.
Expression
Note: This operator modifies the time values of the returned data. For rasters and vector data, it shifts the time intervals opposite to the time shift specified in the operator. This is necessary to have only data inside the result that is part of the QueryRectangle's time interval. As an example, we shift monthly data by one month to the past. Our query rectangle points to February. Then, the operator shifts the query rectangle to January. The data, originally valid for January, is shifted forward to February again, to fit into the original query rectangle, which is February.
type
relative
absolute
"relative"
If type is relative, you need to specify the following parameters:
granularity
TimeGranularity
"months"
value
integer
-1
If the type is absolute, you need to specify the following parameters:
timeInterval
TimeInterval
{ "start": "2010-01-01T00:00:00Z", "end": "2010-02-01T00:00:00Z"}
The TimeShift operator expects either one vector input or one raster input.
source
SingleRasterOrVectorSource
{ "type": "TimeShift", "params": { "type": "relative", "granularity": "months", "value": -1 }, "sources": { "source": { "type": "GdalSource", "params": { "data": { "type": "internal", "datasetId": "00000000-0000-0000-0000-000000000539" } } } } }
{ "type": "TimeShift", "params": { "type": "absolute", "time_interval": { "start": "2010-01-01T00:00:00Z", "end": "2010-02-01T00:00:00Z" } }, "sources": { "source": { "type": "GdalSource", "params": { "data": { "type": "internal", "datasetId": "00000000-0000-0000-0000-000000000539" } } } } }