Python operator/plugin in SNAP 8 not working anymore

Hi all,

I have written a plug-in in Python and build it with Maven following the guide here:

https://senbox.atlassian.net/wiki/spaces/SNAP/pages/42041346/What+to+consider+when+writing+an+Operator+in+Python.

In SNAP 7.0 (Linux version) it worked adequately, but since I have installed SNAP 8.0 (also Linux version) the plug-in does not work anymore. Upon clicking “Run” the following error always pops up immmediately:

On this line in the code, I import snappy. I was wondering if you have any ideas what this error means/suggests.

Thank you in advance.

Lars

1 Like

Could it be that you haven’t reinstalled snappy with SNAP 8.
I guess still the snappy for SNAP 7 is used and it tries to load Java classes which do not exist anymore.
If you have a look in the __init__.py file of your snappy you will see the following (Line 361):

Geometry = jpy.get_type('com.vividsolutions.jts.geom.Geometry')
WKTReader = jpy.get_type('com.vividsolutions.jts.io.WKTReader')

But it should be:

Geometry = jpy.get_type('org.locationtech.jts.geom.Geometry')
WKTReader = jpy.get_type('org.locationtech.jts.io.WKTReader')

This should be solved by installing and configuring snappy again.

4 Likes