Starting with GPT

Hi,

I am a regular user of the GUI of SNAP and want to move to GPT . I am using Ubuntu 16.04 (newbie more than expert in Linux) and SNAP v.6. I would like to use this post to ask several questions during my learning curve and hopefully it can be useful for others in my situation. I have been checking the forum the learn more but still have some doubts and extremely basic questions:

  • The first one is more technical and is related to this topic and this topic. On Terminal, running gpt will result in command not found. I have tried gpt.sh as suggested in the linked post but the same command not found result appears. The solution is then specifyng the path to gpt , in my case usr/local/snap6/bin/gpt and then yes GPT is launched. Is this the regular procedure or am I missing something to be able to launch gpt withouth specifing the path?

  • Right after launching GPT, I try to access an operator usign gpt subset -h as suggested in this tutorial (desing for windows) and the output is again command not found. To really call the operator I have to use the absolute path usr/local/snap6/bin/gpt subset -h. I think I missing some kind of variable definition to let the system now what is gpt and where is it located but since I am new in Linux I don’t have any idea about how to do it.

  • I am trying to run a basic bulk processing where I have 3 S2 images that I want to resample. For that I am using the same approach as here using: /usr/local/snap6/bin/gpt processDataset.bat resamplev3.xml resample_20m.properties "/shared/GPT/Source" "/shared/GPT/Output resampled10m

The first error that appears is flagded as SEVERE: The environment variable LD_LIBRARY_PATH is not set … Based on s2tbx.GDALInstaller error it seems GDAL is not configure in SNAP. How can this be solved? The second error I face is that gpt is looking for the graph xml file in a different path (the home path) and claims that resamplev3.xml does not exist.

Any help on that?

please read here on how to permanently make gpt availably without having to enter the full path every time:

As described in the linbk you posted, processDataset.bat is a Windows script. For linux, there is a bash shell script.
These scripts have the command to run gpt embedded in the script (which generally needs editing to set the location
for gpt on a particular system), per the comments in the script:

############################################
# User Configuration
############################################

# adapt this path to your needs
gptPath="/opt/snap/bin/gpt.sh"

You will find it very useful to spend a bit of time learning more about the linux shell (bash). A very good resource is
LinuxCommand. You can find introductory documentation and tutorials translated into many
languages. For many bash scripts, the documentation is just comments in the script. The scripts are plain text, so
you can view them and make required changes with a text editor. Most linux distributions provide a basic text editor.

As for GDAL and LD_LIBRARY_PATH, the link you give notes that this is real a problem only if you use a GDAL reader or writer.

How to make available for gpt 4