Java SNAP engine or SNAPPY on cloud service


I would like to ask if anyone has been deployed SNAP engine or SNAPPY as a web service on Amazon Lambda Functions or Google Cloud Functions.

If yes, can I have a link to try it?

Is deploying snap engine as a web service violating any policies?

I am looking into an option to deploy “Object Detection” of SNAP engine into web service. I am open for any advices.
Thanks a lot.

Absolutely not, please go for it! :slight_smile:
Regarding whether it has been done already @lveci might have more information.

1 Like

SNAP is used in many online services.

I know that the guys from Google Earth Engine are using SNAP (sometimes there are around in this forum).
I’m not sure about Amazon Lambda, but there should be no problem.
it is used in several Thematic Exploitation Platforms, like Urban TEP, Coastal TEP, Polar TEP (not sure). It is used at CODE-DE and ProbaV MEP, etc.
There is definitely no problem in using SNAP for your web service. Actually, we would like to see it.
However, it would be nice if you mention somewhere that you use SNAP and maybe you introduce shortly your service here in the forum when it is running and if it is of interest for a broader audience.

Regarding your question, using SNAPPY or SNAP directly:
I would prefer SNAP for a service. This means that the tech-stack is small. You don’t have python involved. And currently, there are still some issues with the python support in SNAP (which will be addressed soon). However, it means that you have an additional layer which is a source for errors.
But if you want to let users implement parts of your service, e.g. algorithm then Python is probably a got way. But still, you could directly use Java/SNAP directly and just offer a Python interface.

1 Like

Thanks for great advices. I also have a same thought about using SNAP instead of SNAPPY. Actually, I am more comfortable with programming in JAVA than Python.

I am happy to share my web service when I deploy it :blush:

@marpet How to know which method or class that one gpt operator (Snap cli) belong to?
Another question is: What are dependencies of “gpt” tool?
I need to upload all dependecies to cloud to make sure “gpt” command work.
Thanks :slight_smile:

Hi Nina101,

Usually you don’t need to call the operator classes directly.
You should call all operators via GPF.createProduct(operatorName, parameterMap, sourceProduct)
The operatorName is the one you use with gpt. If you want to find class anyway you can either search for the operatorName in the source code or you open the corresponding processor dialog and select Help/About from the menu. Then you will get a dialog like this
At Full name you see the full class path.
You shoul use all modules from the snap-engine repository. This is the basic. Then it depends which operators you want to use. The modules where the name ends on -ui you can ignore. they are only needed for the desktop.

There is a guide in our wiki which shows how to create a bundle (zip-file) of jars which can then be deployed to a web server or some other processing environment.
How to create a SNAP bundle from source

Also this thread is probably of interest: