API and Architectural Changes in SNAP 10

For SNAP 10 the toolboxes are thematically reorganised.

The S2, S3 and the Proba-V Toolboxes form the new Optical Toolbox. The S1 Toolbox including the RadarSat Toolbox now form the Microwave Toolbox.

Due to this change several modules are renamed and also the packages have been changed to reflect the new structure, even some modules have been moved elsewhere and others are fully removed.

These changes do not affect the usage of SNAP or gpt. Only the location if the code has changed.

Table of Contents

Package name changes

Old Package Path

New Package Path

Old Package Path

New Package Path

org.esa.s1tbx

eu.esa.microwave

org.esa.s1tbx.commons

eu.esa.sar.commons

org.csa.rstb

eu.esa.mwv

org.esa.s2tbx

eu.esa.opt

org.esa.s3tbx

eu.esa.opt

org.vito.probavbox

eu.esa.opt

Also, the modules available on the maven repository will be available under new coordinates. For example

<dependency>

<groupId>eu.esa.opt</groupId>

<artifactId>opttbx-****</artifactId>

<version>10.0.0</version>

</dependency>

or in case of the Microwave Toolbox:

<dependency>

<groupId>eu.esa.mwv</groupId>

<artifactId>mwvtbx-****</artifactId>

<version>10.0.0</version>

</dependency>

 

Parameter name changes

CollocationOp parameter names have been updated to follow the standard naming conventions. Affected methods/properties are:

renameMasterComponents → renameReferenceComponents
renameSlaveComponents → renameSecondaryComponents
masterComponentPattern → referenceComponentPattern
slaveComponentPattern → secondaryComponentPattern

Property names

Properties which have been used and which started with s2tbx or s3tbx now need to start with opttbx.

For example:

s3tbx.reader.olci.pixelGeoCoding ---> opttbx.reader.olci.pixelGeoCoding

Because some properties would have been too generic after the renaming, an additional path element has been added

s2tbx.dataio.detectorFootprintMasks ---> opttbx.dataio.s2msi.detectorFootprintMasks

Moved Modules

The modules snap-unmix and the snap-ndvi are moved into the Optical Toolbox. The snap-ndvi is even integrated into the opttbx-radiometric-indices module.

The former ProbaV Toolbox will not be further maintained as the included module are now integrated into the Optical Toolbox.

If you want to make use of them the dependency needed to be defined have changed

Module

Old Dependency

New Dependency

Module

Old Dependency

New Dependency

snap-unmix

<groupId>org.esa.snap</groupId> <artifactId>snap-unmix</artifactId> <version>9.0.0</version
<groupId>eu.esa.opt</groupId> <artifactId>opttbx-unmix</artifactId> <version>10.0.0</version

snap-ndvi

<groupId>org.esa.snap</groupId> <artifactId>snap-ndvi</artifactId> <version>9.0.0</version

probav-reader

The packages have been changed accordingly:

Old Package Path

New Package Path

Old Package Path

New Package Path

org.esa.snap.unmixing

eu.esa.opt.unmixing

org.esa.snap.ndvi

eu.esa.opt.radiometry

org.vito.probavbox.dataio.probav

eu.esa.opt.dataio.probav

 

doc-windows and tiled-editors modules

Those two modules have been combined and extracted from the project into a separate project.

SNAP utility library for Netbeans GUI component extensions (github.com)

Class packages have changed

Old Package Path

New Package Path

Old Package Path

New Package Path

org.esa.snap.netbeans.docwin

eu.esa.snap.netbeans.docwin

org.esa.snap.netbeans.tile

eu.esa.snap.netbeans.tile

 

Removed modules

The module s3tbx-insitu-client-ui has not been migrated to the new Optical Toolbox. The server is not available anymore and there was no request to bring it back so far.

The modules s2tbx-cache and s2tbx-cache-ui will not be included in the new Optical Toolbox anymore. They are not needed any more for the s2 reader.

Help System Changes

For SNAP 10 we updated to NetBeans version 11.3. Unfortunately, NetBeans removed the help support because of license conflicts. That’s the reason we had to change how help is integrated into SNAP.

Change Help System Dependency

The dependency to the help system needs to be changed. Remove the following from your pom:

and replace it with

 

Register Help Set

If you have used the HelpSetRegistration to register your help you need to change the package path for the class.

Previous:

Now:

 

Invoke Help

How the help must be invoked has changed. Before the help could be invoked by instantiating a HelpCtx object and calling display() on it. Now HelpDisplayer.show(); must be invoked. Either with an instance of HelpCtx or the help ID as String.

External Links

If links to external pages are used and they shall be shown in system browser the html tag needs to be changed as follows:

Before:

Now:

Access to SNAP Java API from Python

SNAP provides a link to Python which enables Python developers to

  1. use the SNAP Java API from Python, and to

  2. extend SNAP by operator plug-ins for EO data processing written in the Python programming language.

In SNAP 10, the access to SNAP from Python is provided by an external plugin ‘esa_snappy'. This plugin basically contains the functionalities of the previous ‘snappy’ module in SNAP versions <= 9. The plugin works with the standard CPython, so that any native Python extension modules such as numpy and scipy can be used. The esa_snappy module depends on a bi-directional Java-Python bridge jpy that enables calls from Python into a Java virtual machine and, at the same time, the other way round. This bridge is implemented by the jpy Project and is independent from the esa_snappy module.

However, compared with the previous snappy, the new esa_snappy now comes with significant improvements:

  • the old package name ‘snappy’ lead to conflicts as other common Python packages exist with this name. E.g., various state-of-the-art Python packages (such as xarraydask) could not be used. This issue was solved by just changing the name to esa_snappy (and adapting the code accordingly).

  • the jpy Project now provides wheels with shared libraries for Python versions up to 3.10 for all platforms (Windows, Unix, MacOSx). Building jpy manually for Python versions > 3.6 is no longer required.

Guidelines how to access, install and use esa_snappy are given in the corresponding doumentation Configure Python to use the new SNAP-Python (esa_snappy) interface (SNAP version 10+) and How to use the SNAP API from Python.