GEOINT App: Proof of concept part I — Ramp Up: Once, twice, three times a runtime…
By: Jan Tschada
Tags: Java, Dotnet, Qt, Geospatial, Software Engineering

The development environment

is going to be a somewhat overaged Windows 10 desktop PC having:

AMD Athlon(tm) II X4 640 Processor, 3000 MHz, 4 Cores, 4 logical Cores

AMD Radeon HD 5450

12 GB of RAM

The Simple JavaFX Map Viewer

First of all, we need a Java 11 development kit, don’t forget the JavaFX libraries which are not part of the SDK, for our Windows 10 based development environment and a MSVC 2017 C++ runtime for the JNI (Java Native Interface) being delivered with the ArcGIS Runtime SDK for Java for using the C++ based runtime core. Don’t be afraid there is no need for using JNI for this simple map viewer.

“No Java developers were harmed by JNI in the making of this proof of concept.”

When I was developing using Java at the beginning of this millennium I was used to IDEs (Integrated Development Environments) like Eclipse and NetBeans. In the meantime we also saw a new funky IDE named IntelliJ rising up, but because the SDK for Java is not offering any IDE specific project templates for creating a simple map viewer — instead is offering maven and gradle support in first place — we are going to use VS Code. By taking a closer look at the VS Code website you will see it reuses the famous Java slogan “Runs everywhere” — so our Java IDE for this proof of concept is going to be VS Code.

You can use the simple java maven archetype quickstart and plug your specific maven dependencies into it or just use a simple startup sample from the Java samples repository. If you follow the setup instructions you have to download and extract the Java and JNI libraries. The path of the libraries must be known at runtime, so you can use one of the following four options:

Setting the installation directory in code by using ArcGISRuntimeEnvironment.setInstallDirectory()

Extracting the libraries into the running application directory

Specifying the path to the libraries by using the environment variable ARCGISRUNTIMESDKJAVA_100_9_0

Extracting the libraries into the “.arcgis” directory in the user’s home path

A java.lang.RuntimeException is thrown when the runtime cannot determine the dependent libraries — and yes I ran into this situation.

Because I am not a maven expert — usually I end up screwing up any local maven repository and the mvn pom hell start yelling at me:

“… one of its dependencies could not be resolved …”

I just decided to use the simple lazy gradle option. In VS Code you need to install the Java extension and open one of the extracted samples e.g. the display-map sample having a gradle build file and expecting a valid gradle development environment — take a look at Maven and Gradle support in VS Code.

VS Code Java Extension

If you forgot to download and specify where to find the JavaFX runtime components an error like

“… JavaFX runtime components are missing, and are required to run this application …”

is thrown during application startup. I used the provided JavaFX components from Gluon and specified the target directory by using the module path as compile arguments in the gradle build script provided by the display-map sample.

At this point if you compile and run the sample the display-map app should start and visualize an imagery basemap.

JavaFX based display-map sample

The Simple WPF .NET Map Viewer

We are going to use Visual Studio Community 2019 edition with the desktop development feature installed. The development of a WPF based ArcGIS Runtime app needs at minimum .NET Framework 4.6.1 and .NET Core 3.1.

We setup our VS IDE by installing the VS extension template named “ArcGIS Runtime SDK for .NET” from the Visual Studio Marketplace. The template offers project templates for creating WPF and UWP based apps. For more details you can visit the ArcGIS Runtime SDK for .NET landing page.

ArcGIS Runtime SDK for .NET templates

For our simple map viewer we need to create a new project by using the “ArcGIS Runtime App” project template. The template creates a C# based project referencing the necessary NuGet packages and the platform dependent x86 and x64 ArcGIS Runtime core libraries.

ArcGIS Runtime SDK for .NET project templates

When compiling and running the map viewer sample the app should display a streets vector tiled basemap.

WPF based map viewer sample

The Simple Qt Quick Map Viewer

When developing with Qt using any development environment we need the Qt SDK provided by the Qt company. On Windows I prefer to use the MSVC C++ 2019 Build Tools which are being shipped with VS 2019. You need to enable the necessary C++ features and have to follow the setup instructions from the Qt SDK.

The Qt SDK includes a set of development tools and a Qt based IDE on its own named Qt Creator. The ArcGIS Runtime SDK for Qt offers a setup which integrates three project templates into Qt Creator during the post installation step.

ArcGIS Runtime SDK for Qt templates

The simple map viewer should offer a neat UI and allow the development of high performance workflows by using C++. Qt Quick provides stylish UI controls and C++ seems to be the right choice. As a result, we are going to use the “Qt Quick C++ app” template for our simple map viewer.

Cross your fingers when compiling the Qt Quick app using qmake and MSVC C++ 2019 — I started using Qt in the 90s and like maven sometimes the configure and make tools do not like me — surprisingly it worked out without any further adjustments. After starting the Qt Quick map viewer directly from Qt Creator the app displays a topographic basemap — big clap to the Qt guys.