Processing backend for javaPS (OGC WPS implementation) containing processes related to the WaCoDiS project for creating
Earth Observation products.
Table of Content
Climate changes and the ongoing intensification of agriculture effect in increased material inputs in watercourses and dams. Thus, water industry associations, suppliers and municipalities face new challenges. To ensure an efficient and environmentally friendly water supply for the future, adjustments on changing conditions are necessary. Hence, the research project WaCoDiS aims to geo-locate and quantify material outputs from agricultural areas and to optimize models for sediment and material inputs (nutrient contamination) into watercourses and dams. Therefore, approaches for combining heterogeneous data sources, existing interoperable web based information systems and innovative domain oriented models will be explored.
For a detailed overview about the WaCoDiS system architecture please visit the WaCoDiS Core Engine repository.
The JavaPS WaCoDiS Backend aims as backend for the great javaPS and provides processing algorithms for generating valuable products (EO-products) from Earth Observation data. Therefore, the provided processes contain basic preprocessing routines for Copernicus satellite data and encapsulate the execution of dockerized tools with purpose for running on both, self hosted processing infrastructures and satellite data platforms with embedded processing environments like CODE-DE.
JavaPS WaCoDiS Backend serves as a processing backend for javaPS and comprises only a single module which contains the EO processing routines. Therefore, it is not executable as stand-alone application but requires to be executed as part of javaPS.
The section below gives a comprehensive overview about the package structure:
Again, javaPS WaCoDiS Backend serves as an extra module for javaPS and therefore is not executable standalone. For building both, an JavaPS WaCoDiS Backend artifact and an executable javaPS WAR file, follow the steps listed below:
mvn clean install
from the project root.mvn clean install -DskipTests -pl !webapp
from the javaPS
project root.mvn -f ./webapp/custom-webapp-pom.xml package -DskipTests -Denforcer.skip=true
from the javaPS project root.For building a javaPS docker image run docker build -t wacodis/javaps:latest --build-arg CACHE_DATE=$(date) .
.
The build time argument CACHE_DATE
can be used to invalidate cache in order to only build the changed javaps-wacodis-backend.
For running the javaPS WaCoDiS Backend as Docker container, the deployment section provides some helpful information.
To configure your javaPS instance including the WaCoDiS backend, you have to consider both the configuration related to javaPS and config parameters that directly refers to the backend.
You'll find the javaPS configuration file inside the webapp module within src/main/webapp/WEB-INF/config. Here you can
set different parameters related to the server. Note, that you especially have to set the correct server URL for the
service.serviceURL
parameter so that javaPS generates proper download links for its outputs. In addition, all configuration
parameters can be set via environment variables. E.g., service.serviceURL
can be set via SERVICE_SERVICE_URL
.
Configuration parameters meant for the javaPS WaCoDiS Backend can be defined inside the properties file src/main/resources/wacodis-javaps.properties or as environment variables.
In order to access satellite data from Copernicus Open Access Hub you have to specify valid credentials:
openaccesshub.username
: ESA Open Access Hub usernameopenaccesshub.password
: ESA Open Access Hub passwordYou also have to specify different directories to be used as working directory or to look for process related files:
wacodis.javaps.workdir
: Absoulte path to the working directory. All downloaded and preprocessed files will be
stored at this locationwacodis.javaps.toolconfigdir
: Absolute path to the directory which contains the config files for executing the EO toolswacodis.javaps.gpfdir
: Absolute path to the directory which contains the SNAP GPF XML-Files for preprocessing Sentinel satellite data. Some additional parameters:
wacodis.javaps.epsg
: EPSG code representing the reference coordinate system that will be used for reprojecting all
input data.wacodis.javaps.sentineltestfile
(optional): Absolute path to a Sentinel-2 product in SAFE-format that can be used for
testing purposes in order to prevent downloading Sentinel-2 products from a certain platform, which may be very time-consuming.If you choose to build the project from source, the deployment of the javaPS WaCoDiS Backend highly depends on javaPS, since the backend can not be deployed standalone. In addition, a web container is required for deploying the javaPS including the bundled WaCoDiS Backend.
If you choose to build the project with Docker, the deployment only depends on the availability of Docker Engine within your runtime environment. No additional software stacks are required in this case.
A pre-built Docker image can be pulled from DockerHub. You can
simply start the container with docker-compose. A docker-compose.yml is provided within the docker directory.
Just run docker-compose --compatibility up
. The --compatibility
flag enables memory configurations specified within
the docker-compose.yml.
If you prefer docker run you can also execute docker run -p 8080:8080 --env-file ./wacodis.env wacodis/javaps:latest
or any similar command.
Be sure to overwrite the properties in wacdodis.env
just to provide the credentials for the Copernicus Open Access Hub
and to set the working directories. The docker directory also contains configuration files used for the execution
of containerized EO-tools as well as graph XML files for running GPF graphs.
Just copy those files to a new location and point the relevant properties within wacdodis.env
to this location.
To run javaPS including the WaCoDiS Backend within a Tomcat instance, you first have to build the project from source.
Be sure, you have set proper configuration parameters for javaPS and javaPS
inside the configuration files or via environment variables. You'll find
configuration files used for the execution containerized EO-tools as well as
graph XML files for running GPF graphs inside the docker directory. Just point
wacodis.javaps.toolconfigdir
and wacodis.javaps.gpfdir
to these locations. Note, that each EO-tool configuration
specifies a Docker Host URL that points to the Unix socket, i.e. unix:///var/run/docker.sock
. If you aim to run the
javaPS on a Windows system change the Docker Host URL to tcp://localhost:2376
.
javaPS implements the OGC WPS 2.0 interface. To execute WPS processes send your requests to the following endpoint: http://localhost:8080/wacodis-javaps/service. For convenience, you'll find a ready-to-use Postman collection that contains execution requests for all supported processes inside docs folder. Just import the collection within Postman, set appropriate values for the process inputs and send your POST requests to the WPS.
You can simply develop your own algorithms as javaPS processes. Just follow the detailed javaPS documentation. Of course, you can implement you algorithms however you want and use your favorite library to do so. However, we recommend following one of the patterns almost all the processes within this repository rely on.
Some processes within this repository utilize the SNAP Graph Processing Framework via Java API. Those algorithms rather execute single GPF operators in standalone mode without any complex graph definitions. Only a small subset of Sentinel-1 or Sentinel-2 toolbox operators are valuable, namely those which produce a ready-to-use product. Hence, some basic indices-based operators are embedded within separate algorithms so far. You will find those algorithms inside the org.n52.wacodis.javaps.algortihms.package.
If you want to provide you own algorithm that
makes use of SNAP GPF operators, just implement AbstractSnapAlgorithm
which already provides some boilerplate code
for executing operators via GPF. Make sure, you are confirm with all supported parameters for your operator. E.g., the
parameters for the NDVI operator have been discovered from the NdviOp class.
SNAP Graph Processing Framework can not
only be used for executing operators in standalone mode but also for applying complex preprocessing graphs on satellite data
to prepare large datasets for the execution via containerized EO-tools. To do so, it
is best practice to prepare your GPF graph via SNAP, export it as
XML file and add it to the javaPS. Finally, you can make use of org.n52.wacodis.javaps.preprocessing.gpt.GptExecutor
to execute your graph as part of the preprocessing within your custom algorithm.
To get the best out of your satellite data processing and to generate valuable products, you can provide your processing algorithms as Docker containers that will be triggered by an WPS process.
static-option
means the provided value
will be used as is for the execution command. In contrast,
wps-process-reference
arguments must explicitly be defined inside the WPS process and its values will be set at runtime.
Have a look on how this is done for VegetationDensityNdviAlgorithm.org.n52.wacodis.javaps.algorithms.AbstractAlgorithm
which provides several reusable methods. Simply follow
the way this have been already done for the existing algorithms inside org.n52.wacodis.javaps.algortihms.The master branch provides sources for stable builds. The develop branch represents the latest (maybe unstable) state of development.
TODO
Name | Organization | |
---|---|---|
Sebastian Drost | Bochum University of Applied Sciences | sebastian.drost@hs-bochum.de |
Arne Vogt | Bochum University of Applied Sciences | arne.vogt@hs-bochum.de |
Matthes Rieke | 52° North GmbH | m.rieke@52north.org |
Adrian Klink | EFTAS Fernerkundung Technologietransfer GmbH | adrian.klink@eftas.com |
The research project WaCoDiS is funded by the BMVI as part of the mFund programme