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{
}}\preformatted{Collection$new(id = NA, title = NA, description = NA)}\if{html}{\out{
}} +\if{html}{\out{
}}\preformatted{Collection$new( + id = NA, + title = NA, + description = NA, + spatialExtent = NA, + temporalExtent = NA, + bands = NA, + constellation = NA +)}\if{html}{\out{
}} } \subsection{Arguments}{ @@ -53,81 +56,20 @@ Initialize collection \item{\code{title}}{Collection title} \item{\code{description}}{Short description of the collection} -} -\if{html}{\out{}} -} -} -\if{html}{\out{
}} -\if{html}{\out{}} -\if{latex}{\out{\hypertarget{method-Collection-setCollection}{}}} -\subsection{Method \code{setCollection()}}{ -Add image collection to the collection class object -\subsection{Usage}{ -\if{html}{\out{
}}\preformatted{Collection$setCollection(ImageCollection)}\if{html}{\out{
}} -} -\subsection{Arguments}{ -\if{html}{\out{
}} -\describe{ -\item{\code{ImageCollection}}{Collection of class 'image collection'} -} -\if{html}{\out{
}} -} -} -\if{html}{\out{
}} -\if{html}{\out{}} -\if{latex}{\out{\hypertarget{method-Collection-getCollection}{}}} -\subsection{Method \code{getCollection()}}{ -Get assigned image collection -\subsection{Usage}{ -\if{html}{\out{
}}\preformatted{Collection$getCollection()}\if{html}{\out{
}} -} +\item{\code{spatialExtent}}{Spatial extent of the collection} -\subsection{Returns}{ -image collection -} -} -\if{html}{\out{
}} -\if{html}{\out{}} -\if{latex}{\out{\hypertarget{method-Collection-setMetadata}{}}} -\subsection{Method \code{setMetadata()}}{ -add extent and bands to the metadata of the collection object -\subsection{Usage}{ -\if{html}{\out{
}}\preformatted{Collection$setMetadata()}\if{html}{\out{
}} -} - -} -\if{html}{\out{
}} -\if{html}{\out{}} -\if{latex}{\out{\hypertarget{method-Collection-getMetadata}{}}} -\subsection{Method \code{getMetadata()}}{ -Get metadata of the collection -\subsection{Usage}{ -\if{html}{\out{
}}\preformatted{Collection$getMetadata()}\if{html}{\out{
}} -} +\item{\code{temporalExtent}}{Temporal extent of the collection} -\subsection{Returns}{ -metadata of the collection -} -} -\if{html}{\out{
}} -\if{html}{\out{}} -\if{latex}{\out{\hypertarget{method-Collection-getEoBands}{}}} -\subsection{Method \code{getEoBands()}}{ -Convert bandlist to be openeo compliant -\subsection{Usage}{ -\if{html}{\out{
}}\preformatted{Collection$getEoBands()}\if{html}{\out{
}} +\item{\code{bands}}{Bands of the collection} } - -\subsection{Returns}{ -converted bandlist +\if{html}{\out{}} } } \if{html}{\out{
}} \if{html}{\out{}} \if{latex}{\out{\hypertarget{method-Collection-collectionInfo}{}}} \subsection{Method \code{collectionInfo()}}{ -List metadata for the collection handler \subsection{Usage}{ \if{html}{\out{
}}\preformatted{Collection$collectionInfo()}\if{html}{\out{
}} } @@ -137,7 +79,6 @@ List metadata for the collection handler \if{html}{\out{}} \if{latex}{\out{\hypertarget{method-Collection-collectionInfoExtended}{}}} \subsection{Method \code{collectionInfoExtended()}}{ -List extended metadata for the collection handler \subsection{Usage}{ \if{html}{\out{
}}\preformatted{Collection$collectionInfoExtended()}\if{html}{\out{
}} } diff --git a/man/landsat_8_l1_c1.Rd b/man/landsat_8_l1_c1.Rd deleted file mode 100644 index 28b1f55..0000000 --- a/man/landsat_8_l1_c1.Rd +++ /dev/null @@ -1,16 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/Collection-class.R -\docType{data} -\name{landsat_8_l1_c1} -\alias{landsat_8_l1_c1} -\title{landsat-8-l1-c1} -\format{ -An object of class \code{Collection} (inherits from \code{R6}) of length 13. -} -\usage{ -landsat_8_l1_c1 -} -\description{ -landsat-8-l1-c1 -} -\keyword{datasets} diff --git a/man/sentinel_s2_l1c.Rd b/man/sentinel_s2_l1c.Rd deleted file mode 100644 index a3ffe03..0000000 --- a/man/sentinel_s2_l1c.Rd +++ /dev/null @@ -1,16 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/Collection-class.R -\docType{data} -\name{sentinel_s2_l1c} -\alias{sentinel_s2_l1c} -\title{sentinel-s2-l1c} -\format{ -An object of class \code{Collection} (inherits from \code{R6}) of length 13. -} -\usage{ -sentinel_s2_l1c -} -\description{ -sentinel-s2-l1c -} -\keyword{datasets} diff --git a/man/sentinel_s2_l2a.Rd b/man/sentinel_s2_l2a.Rd deleted file mode 100644 index a755c30..0000000 --- a/man/sentinel_s2_l2a.Rd +++ /dev/null @@ -1,16 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/Collection-class.R -\docType{data} -\name{sentinel_s2_l2a} -\alias{sentinel_s2_l2a} -\title{sentinel-s2-l2a} -\format{ -An object of class \code{Collection} (inherits from \code{R6}) of length 13. -} -\usage{ -sentinel_s2_l2a -} -\description{ -sentinel-s2-l2a -} -\keyword{datasets} diff --git a/man/sentinel_s2_l2a_cogs.Rd b/man/sentinel_s2_l2a_cogs.Rd index 50684f7..94c88a4 100644 --- a/man/sentinel_s2_l2a_cogs.Rd +++ b/man/sentinel_s2_l2a_cogs.Rd @@ -5,7 +5,7 @@ \alias{sentinel_s2_l2a_cogs} \title{sentinel-s2-l2a-cogs} \format{ -An object of class \code{Collection} (inherits from \code{R6}) of length 13. +An object of class \code{Collection} (inherits from \code{R6}) of length 12. } \usage{ sentinel_s2_l2a_cogs diff --git a/startLocal.R b/startLocal.R index 755f05f..d32e807 100644 --- a/startLocal.R +++ b/startLocal.R @@ -14,6 +14,6 @@ if (aws.host == "") { config <- SessionConfig(api.port = 8000, host = "0.0.0.0", aws.ipv4 = aws.host) -config$workspace.path <- "/var/openeo/workspace" +config$workspace.path = paste0(getwd(), "/test_workspace") createSessionInstance(config) Session$startSession()