You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When we apply gdalcubes::select_time() with a single time value, we get an object that does not have a start and end time. When we then use st_as_stars() to convert this to a stars object, we get an erroneous end time. (Sometimes this is the origin time, 1970-01-01, which is bad, but sometimes I get non-date-times for this, which lead to breaking errors).
We can see this error using a simple modification to the example code for select_time()
# create image collection from example Landsat data only # if not already done in other examplesif (!file.exists(file.path(tempdir(), "L8.db"))) {
L8_files<- list.files(system.file("L8NY18", package="gdalcubes"),
".TIF", recursive=TRUE, full.names=TRUE)
create_image_collection(L8_files, "L8_L1TP", file.path(tempdir(), "L8.db"), quiet=TRUE)
}
L8.col= image_collection(file.path(tempdir(), "L8.db"))
v= cube_view(extent=list(left=388941.2, right=766552.4,
bottom=4345299, top=4744931, t0="2018-04", t1="2018-07"),
srs="EPSG:32618", nx=497, ny=526, dt="P1M")
L8.cube= raster_cube(L8.col, v)
L8.rgb= select_bands(L8.cube, c("B02", "B03", "B04"))
When we apply
gdalcubes::select_time()
with a single time value, we get an object that does not have a start and end time. When we then usest_as_stars()
to convert this to a stars object, we get an erroneous end time. (Sometimes this is the origin time, 1970-01-01, which is bad, but sometimes I get non-date-times for this, which lead to breaking errors).We can see this error using a simple modification to the example code for
select_time()
Now select only one time:
gives us:
Note the erroneous end time (1970-01-01).
The text was updated successfully, but these errors were encountered: