appelmar / gdalcubes_cpp

Earth observation data cubes from GDAL image collections
MIT License
74 stars 7 forks source link

Feature requests #9

Open appelmar opened 5 years ago

appelmar commented 5 years ago

This issue collections ideas for important features to be added. Highlighted items should be considered for the next minor release.

General Features:

Data cube operations:

Image Collection:

CLI

DaChro commented 5 years ago
pierreroudier commented 5 years ago
appelmar commented 5 years ago

@pierreroudier there is actually a (not very user-friendly) workaround to do this in the R package with the chunk_apply, function. However, I am planning to improve this by letting users pass a function to reduce_time and reduce_space.

For example, calling something like reduce_time(x, function(y) { summary(y)} ) on a single band input cube x would return a 6 band cube with time series summaries.

More general, y would be the complete time series of one pixel containing all bands and the function would return one or more values that are interpreted as new bands of the resulting cube.

I've added this to the feature request list on top of the issue.

pierreroudier commented 5 years ago

@appelmar Excellent. If that helps, my use case would be to reduce a time series of imagery using a non-standard reducer (ie other then your usual mean, median, etc).

mdsumner commented 5 years ago

One thing I'm hoping to do is allow the assignment of the CRS to a collection series, it seems that none of our data-library NetCDF files have this recognized by GDAL itself. It should be enough to apply GDALSetProjection, but I can't see yet in gdalcubes where the right place for this is.

@appelmar I know you said it wasn't possible, but I can't see why? And, it might be easy for you to apply this? I consider it the responsibility of a configuration author, so it could be a new field in there - a full WKT input CRS, otherwise an error for a source that doesn't have it.

I've experimented with this using the warper and it seems fine:

https://github.com/hypertidy/vapour/blob/f3bc80ddeeef1e7148c6cab2ff81353deea429ad/src/raster_warp.cpp#L32

appelmar commented 5 years ago

@mdsumner Thanks, the current dev branches of gdalcubes and gdalcubes_R now support the definition of a global SRS in image collection formats (see example here). This field is of course optional, making sense only for data products using the same SRS for all images. During the creation of an image collection, all files are expected to use the provided SRS; if a file has a different SRS according to the GDAL metadata, a warning will be given.

Here is an R example, using the example collection format and data from https://www.ncei.noaa.gov/data/sea-surface-temperature-optimum-interpolation/access/avhrr-only/198307/:

library(gdalcubes)
library(magrittr)

files = list.files("/path/to/AVHRR_Only", pattern=".nc", full.names = TRUE)
x = create_image_collection(files, "/path/to/NOAA_OISST_AVHRR_Only.json")

raster_cube(x, cube_view(extent=x, srs="EPSG:4326", nx=500, dt="P1D")) %>%
  select_bands(c("sst")) %>%
  plot(key.pos=1, col=viridis::viridis)
mdsumner commented 5 years ago

Oh nice, thanks!