Use of gpt SNAP on MACOS ( Please help :) )

command line tutorial.pdf (472.8 KB)

Hi guys, I am a beginner user. I need to automate the process of coregistration of Sentinel 1 and Sentinel 2 products, so I would like to use gpt.

Until now, I have downloaded the SNAP GUI. What is the step by step procedure to install gpt on MACOS? Surely, I haven’t installed it because if I go snap->bin and from terminal run the command gpt the terminal output is: usage: gpt [-frv] [-p nparts] command [options] device …

Hoping in help :slight_smile:

1 Like

The GUID partition tables tool is invoked here first on macos.
If you tell the command line too look first in the current directory it should work.
Invoke it like this:

./gpt -h

This should print you the help.

3 Likes

Dear Marco, reading carefully the help message, I noted that there is something wrong.

Before the standard message:
Usage:

Description

I have

(base) Luca@MacBook-Pro bin % ./gpt -h
INFO: org.esa.snap.core.gpf.operators.tooladapter.ToolAdapterIO: Initializing external tool adapters
INFO: org.esa.s2tbx.dataio.gdal.GDALVersion: GDAL 3.0.2 found on system. JNI driver will be used.
INFO: org.esa.s2tbx.dataio.gdal.GDALVersion: Installed GDAL 3.0.2 set to be used by SNAP.
Native library load failed.

java.lang.UnsatisfiedLinkError: /Users/Luca/.snap/auxdata/gdal/gdal-3-0-X-jni/libgdalalljni.dylib: dlopen(/Users/Luca/.snap/auxdata/gdal/gdal-3-0-X-jni/libgdalalljni.dylib, 0x0001): Library not loaded: /usr/local/lib/libgdal.26.dylib

Referenced from: /Users/Luca/.snap/auxdata/gdal/gdal-3-0-X-jni/libgdalalljni.dylib

Reason: tried: ‘/usr/local/lib/libgdal.26.dylib’ (no such file), ‘/System/Volumes/Preboot/Cryptexes/OS/usr/local/lib/libgdal.26.dylib’ (no such file), ‘/usr/local/lib/libgdal.26.dylib’ (no such file), ‘/usr/lib/libgdal.26.dylib’ (no such file, not in dyld cache)

SEVERE: org.esa.s2tbx.dataio.gdal.GDALLoader: Failed to initialize GDAL native drivers. GDAL readers and writers were disabled.java.lang.reflect.InvocationTargetException

INFO: org.esa.snap.core.util.EngineVersionCheckActivator: Please check regularly for new updates for the best SNAP experience.

Usage:
gpt | [options] [ …]

How can I fix this issue and use gpt?

1 Like

It seems that you have installed an older version of GDAL (version 3.0.2) and SNAP tries to use it but the necessary libraries can’t be loaded. Actually, SNAP comes with its own GDAL (version 3.2.1).
Maybe you uninstall your GDAL local or you tell SNAP to use the internal one.

@diana_harosa might be able to add some information.
.

1 Like

Thank you Marco for tagging me.
Dear user, our recommendation is to use the internal GDAL distribution.
Following the major version release (9.0.0), a few adjustments were made to the GDAL reader to ensure its compatibility with MacOS. Before starting your processing with SNAP, please make sure you have all updates installed (Help menu → Check for Updates):
image

and delete the content of the /Users/Luca/.snap/auxdata/gdal folder.

The current SNAP version is 9.0.8 (with S2TBX version 9.0.2). You can see it in the About SNAP window:

2 Likes

Thank you both. It works :slight_smile: Just a question. The attachment shows the output of the execution. The output product is not corrupted and can be correctly opened in the graphical interface. But there are several warnings. Is it normal? @diana_harosa @Marco_EOM

1 Like

Yes, they are okay. S2 data can come in different configurations and the warnings say that not elements are available. That’s okay and does not affect your results.