Scala and SNAP

Hi there,

Apologies if this is the wrong place to ask but I’m planning to convert my Python processing pipeline for SAR imagery to Scala code to run on a Hadoop environment. As SNAP is written in Java I assume I could use it within Scala, is there a Maven dependency for the SNAP engine? How would I go about calling SNAP engine code within a Java development environment? It was somewhat easier with Python as snappy was a great interface between the two.

Sorry for the slightly inexperienced question!

Many thanks,

Ciaran

Have a look at the code here https://github.com/senbox-org

For maven, you would need the snap-repo

<repository>
        <id>snap-repo-public</id>
        <name>Public Maven Repository for SNAP</name>
        <url>http://nexus.senbox.net/nexus/content/repositories/releases/</url>
        <uniqueVersion>false</uniqueVersion>
</repository>

I don't believe there is a single snap artifact to include all modules. You may need to include dependencies to the modules you use.

Typically, we do not claim to offer first class support for a language/framework on Snap unless we provide some basic heuristics to help users set up their builds. Based on this defintion, Snap currently supports Ruby, Rails & Java builds. However, Snap can run builds for any JVM based language. In this post, I will talk about how to set up a build for simple Scala/Play project.

If you have your own project on GitHub you can use that. You would need to add sbt-laucher to your project if not present and a script to invoke it. This might look something like

curl -LO http://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/sbt-launch//0.12.4/sbt-launch.jar
echo ‘java -Xms512M -Xmx1536M -Xss1M -XX:+CMSClassUnloadingEnabled -XX:MaxPermSize=384M -jar dirname $0/sbt-launch.jar “$@”’ > sbt
chmod u+x sbt