diff --git a/DESCRIPTION b/DESCRIPTION index 70986ea..5536568 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -26,7 +26,7 @@ Imports: gdalcubes, rstac Roxygen: list(markdown = TRUE) -RoxygenNote: 7.2.3 +RoxygenNote: 7.3.1 Collate: 'api_process_graphs.R' 'api_job.R' diff --git a/R/Collection-class.R b/R/Collection-class.R index 87674c1..7399376 100644 --- a/R/Collection-class.R +++ b/R/Collection-class.R @@ -14,75 +14,30 @@ Collection <- R6Class( id = NULL, title = NULL, description = NULL, + spatialExtent = NULL, + temporalExtent = NULL, + bands = NULL, + constellation = NULL, #' @description Initialize collection #' #' @param id Id of the collection #' @param title Collection title #' @param description Short description of the collection + #' @param spatialExtent Spatial extent of the collection + #' @param temporalExtent Temporal extent of the collection + #' @param bands Bands of the collection #' - initialize = function(id = NA, title = NA, description = NA) { - + initialize = function(id = NA, title = NA, description = NA, spatialExtent = NA, temporalExtent = NA, bands = NA, constellation = NA) { self$id = id self$title = title self$description = description + self$spatialExtent = spatialExtent + self$temporalExtent = temporalExtent + self$bands = bands + self$constellation = constellation }, - #' @description Add image collection to the collection class object - #' - #' @param ImageCollection Collection of class 'image collection' - #' - setCollection = function(ImageCollection) { - if (! gdalcubes:::is.image_collection(ImageCollection)) { - stop("Assigned data is not an image collection") - } - - private$imageCollection = ImageCollection - self$setMetadata() - }, - - #' @description Get assigned image collection - #' - #' @return image collection - #' - getCollection = function() { - return(private$imageCollection) - }, - - #' @description add extent and bands to the metadata of the collection object - #' - setMetadata = function() { - - private$metadata = list( - extent = extent(private$imageCollection), - bands = gdalcubes:::libgdalcubes_image_collection_info(private$imageCollection)$bands$name - ) - }, - - #' @description Get metadata of the collection - #' - #' @return metadata of the collection - #' - getMetadata = function() { - return(private$metadata) - }, - - #' @description Convert bandlist to be openeo compliant - #' - #' @return converted bandlist - #' - getEoBands = function() { - - list = list() - bands = as.list(self$getMetadata()$bands) - list = lapply(bands, function(x) { - append(list, list(name = x)) - }) - return(list) - }, - - #' @description List metadata for the collection handler - #' collectionInfo = function() { list( stac_version = Session$getConfig()$stac_version, @@ -92,29 +47,26 @@ Collection <- R6Class( license = "proprietary", extent = list( spatial = list( - bbox = list(list(self$getMetadata()$extent$left, self$getMetadata()$extent$bottom, - self$getMetadata()$extent$right, self$getMetadata()$extent$top)) + bbox = list(self$spatialExtent) ), temporal = list( - interval = list(list(self$getMetadata()$extent$t0, self$getMetadata()$extent$t1)) + interval = list(self$temporalExtent) ) ), - links = list( - list( - rel = "self", - href = paste(Session$getConfig()$base_url, "collections", self$id, sep = "/") - ), - list( - rel = "parent", - href = paste(Session$getConfig()$base_url, "collections", sep = "/") - )) + links = list( + list( + rel = "self", + href = paste(Session$getConfig()$base_url, "collections", self$id, sep = "/") + ), + list( + rel = "parent", + href = paste(Session$getConfig()$base_url, "collections", sep = "/") + ) + ) ) }, - #' @description List extended metadata for the collection handler - #' collectionInfoExtended = function() { - list( stac_version = Session$getConfig()$stac_version, stac_extensions = list(Session$getConfig()$stac_extensions), @@ -124,46 +76,44 @@ Collection <- R6Class( license = "proprietary", extent = list( spatial = list( - bbox = list(list(self$getMetadata()$extent$left, self$getMetadata()$extent$bottom, - self$getMetadata()$extent$right, self$getMetadata()$extent$top)) + bbox = list(self$spatialExtent) ), temporal = list( - interval = list(list(self$getMetadata()$extent$t0, self$getMetadata()$extent$t1)) + interval = list(self$temporalExtent) ) ), - links = list(list( - rel = "root", - href = paste(Session$getConfig()$base_url, "collections", sep = "/")) + links = list( + list( + rel = "root", + href = paste(Session$getConfig()$base_url, "collections", sep = "/") + ) ), "cube:dimensions" = list( x = list( type = "spatial", axis = "x", - extent = list(self$getMetadata()$extent$left, self$getMetadata()$extent$right - ) + extent = list(self$spatialExtent[1], self$spatialExtent[3]) ), y = list( type = "spatial", axis = "y", - extent = list(self$getMetadata()$extent$bottom, self$getMetadata()$extent$top - ) + extent = list(self$spatialExtent[2], self$spatialExtent[4]) ), t = list( type = "temporal", - extent = list(self$getMetadata()$extent$t0, self$getMetadata()$extent$t1) + extent = self$temporalExtent ), bands = list( type = "bands", - values = list(self$getMetadata()$bands) + values = self$bands ) ), - summaries = list(constellation = list(""), 'eo:bands' = self$getEoBands()) + summaries = list( + constellation = list(self$constellation), + 'eo:bands' = self$bands + ) ) } - ), - private = list( - imageCollection = NULL, - metadata = NULL ) ) @@ -172,31 +122,50 @@ is.Collection = function(obj) { return("Collection" %in% class(obj)) } +# Example collections +# Instantiate collections #'sentinel-s2-l2a-cogs sentinel_s2_l2a_cogs <- Collection$new( id = "sentinel-s2-l2a-cogs", title = "Sentinel 2 L2A COGs", - description = "Sentinel-2a and Sentinel-2b imagery, processed to Level 2A (Surface Reflectance) and converted to Cloud-Optimized GeoTIFFs." + description = "Sentinel-2a and Sentinel-2b imagery, processed to Level 2A (Surface Reflectance) and converted to Cloud-Optimized GeoTIFFs.", + spatialExtent = list(-180, -90, 180, 90), + temporalExtent = list("2015-06-27T10:25:31.456000Z", "null"), + bands = c("B01", "B02", "B03", "B04", "B05", "B06", "B07", "B8", "B8A", "B9", "B10", "B11", "B12", "AOT", "WVP","SCL"), + constellation = list("sentinel-2") ) -#'sentinel-s2-l2a +# sentinel-s2-l2a sentinel_s2_l2a <- Collection$new( id = "sentinel-s2-l2a", title = "Sentinel 2 L2A", - description = "Sentinel-2a and Sentinel-2b imagery, processed to Level 2A (Surface Reflectance)." + description = "Sentinel-2a and Sentinel-2b imagery, processed to Level 2A (Surface Reflectance).", + spatialExtent = list(-180, -90, 180, 90), + temporalExtent = list("2015-06-27T10:25:31.456000Z", "null"), + bands = c("B01", "B02", "B03", "B04", "B05", "B06", "B07", "B8", "B8A", "B9", "B10", "B11", "B12", "AOT", "WVP","SCL"), + constellation = list("sentinel-2") ) -#'sentinel-s2-l1c + +# sentinel-s2-l1c sentinel_s2_l1c <- Collection$new( id = "sentinel-s2-l1c", title = "Sentinel 2 L1C", - description = "Sentinel-2a and Sentinel-2b imagery, processed to Level 1C (Top-Of-Atmosphere Geometrically Corrected)." + description = "Sentinel-2a and Sentinel-2b imagery, processed to Level 1C (Top-Of-Atmosphere Geometrically Corrected).", + spatialExtent = list(-180, -90, 180, 90), + temporalExtent = list("2015-06-27T10:25:31.456000Z","null"), + bands = c("B01", "B02", "B03", "B04", "B05", "B06", "B07", "B8", "B8A", "B9", "B10", "B11", "B12"), + constellation = list("sentinel-2") ) -#'landsat-8-l1-c1 +# landsat-8-l1-c1 landsat_8_l1_c1 <- Collection$new( id = "landsat-8-l1-c1", title = "Landsat-8 L1 Collection-1", - description = "Landat-8 L1 Collection-1 imagery radiometrically calibrated and orthorectified using gound points and Digital Elevation Model (DEM) data to correct relief displacement." + description = "Landat-8 L1 Collection-1 imagery radiometrically calibrated and orthorectified using ground points and Digital Elevation Model (DEM) data to correct relief displacement.", + spatialExtent = list(-180, -90, 180, 90), + temporalExtent = list("2013-06-01T00:00:00Z", "null"), + bands = c("B1", "B2", "B3", "B4", "B5", "B6", "B7", "B8", "B8A", "B9", "B10", "B11"), + constellation = list("Landsat 8") ) diff --git a/README.md b/README.md index 2734a84..1458ee7 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # OpenEOcubes: openEO Compliant Lightweight R Platform for Processing Satellite Image Time Series -The service integrates STAC API (using Rstac package), the OpenEO standardized API, and data cubes concepts (using gdalcubes R package) to be a lightweight platform to enable analysis of time series satellite images via OpenEO Compliant RESTful endpoints using R-Client. It also supports users to run their custom R functions. +The service integrates STAC API (using Rstac package), the OpenEO standardized API, and data cubes concepts (using gdalcubes R package) to be a lightweight platform to enable analysis of time series satellite images via OpenEO Compliant RESTful endpoints using R, Python and JavaScript Clients. It also supports users to run their custom R functions. #### Motivation for the platform: The service tries to improve on the limitations of established EO data management platforms like Google Earth Engine and Sentinel Hub by supporting: @@ -11,7 +11,7 @@ The service tries to improve on the limitations of established EO data manageme * Open Governance * No Need for User Management * User-Defined R Functions -* Flexibility - Custom CRS, and Quick Resampling of Massive EO Data +* Flexibility - Custom CRS,Quick Resampling of 'Large' EO Data ![](docs/openeocubes.png) @@ -22,9 +22,9 @@ After processing the data , one can download and explore on open source tools l #### Future developments: Geospatial Machine Learning APIs for time-series EO Data: * ML APIs e.g. Random Forest, SVM, XGBoost, etc. -* DL APIs e.g. TempCNN, ResNet, etc. +* DL APIs e.g. TempCNN, ResNet, LSTM etc. -Currently PoC is being worked on at [this reposity](https://github.com/Open-Earth-Monitor/openeosits) on the [Open Earth Monitor Cyberinfrastructure](https://earthmonitor.org/) EU funded project. +Currently, PoC for ML APIs is being worked under the [Open Earth Monitor Cyberinfrastructure](https://earthmonitor.org/) EU funded project. ## Easy Deployment from DockerHub Assuming you have Docker installed. This is the easiest approach. You can get a hosted Docker image of the platform on DockerHub diff --git a/man/Collection.Rd b/man/Collection.Rd index f98b9ad..a62d7b9 100644 --- a/man/Collection.Rd +++ b/man/Collection.Rd @@ -26,11 +26,6 @@ This class represents the collections, which contain a set of Granules. \subsection{Public methods}{ \itemize{ \item \href{#method-Collection-new}{\code{Collection$new()}} -\item \href{#method-Collection-setCollection}{\code{Collection$setCollection()}} -\item \href{#method-Collection-getCollection}{\code{Collection$getCollection()}} -\item \href{#method-Collection-setMetadata}{\code{Collection$setMetadata()}} -\item \href{#method-Collection-getMetadata}{\code{Collection$getMetadata()}} -\item \href{#method-Collection-getEoBands}{\code{Collection$getEoBands()}} \item \href{#method-Collection-collectionInfo}{\code{Collection$collectionInfo()}} \item \href{#method-Collection-collectionInfoExtended}{\code{Collection$collectionInfoExtended()}} \item \href{#method-Collection-clone}{\code{Collection$clone()}} @@ -42,7 +37,15 @@ This class represents the collections, which contain a set of Granules. \subsection{Method \code{new()}}{ Initialize collection \subsection{Usage}{ -\if{html}{\out{