java.lang.NullPointerException in running Random Forest classification using classifier file

I am trying to classify imagery data of SCATSAT-1 (.tiff, ) by applying Random Forest classification. I am using a classifier .XML file in the code.

code is here,

and the result is here,

in SNAP-Desktop, RF can be performed using the classifier file (.class file).
The files I am using can be found here SNAP-Python - Google Drive

What advantage do you expect to get from snappy? Have you tried running your new classifier using the GPT command-line tool? If you want to loop over multiple input files, snappy memory management may create problems, but you can use the working gpt command-line in python with subprocess.run.

1 Like

Have you tried to run it from command line with a graph?
Would e good if you would try. Attached is the graph file and you should be able to run it with the following command:
gpt G:/Data/Classifier/rfc.xml -f GeoTIFF -t G:/Data/Classified/Classified.tif G:/Data/265_2018_scatsat_1.tif
You might need to adapt the paths.

rfc.xml (551 Bytes)

@lveci can you have a look too?