GEOINT App: Proof of concept part I — Ramp Up: Once, twice, three times a runtime…

Jan Tschada
Geospatial Intelligence
7 min readNov 22, 2020

I received a lot of feedback about my considerations of building a Geospatial Intelligence App being based on Qt. You can take a closer look at this story here: Design considerations for a Geospatial Intelligence App and it should be Qt.

There is a need for a high level comparison of different technologies to get a better understanding why we want to use Qt. For this proof of concept we are focusing on desktop development and try to develop a standalone app which offers basemap visualization, feature rendering and querying operational intelligence data.

Common native runtime core offering geospatial functionality

For the development of the standalone app we are going to use Java, .NET and Qt. You will find a bunch of different geospatial libraries and frameworks for all of these. The different implementations offer similar functionalities but usual have very different technology footprints because of their dependencies on various 3rd party components. From an engineers perspective this would be like comparing apples and oranges.

A geospatial app should offer high performance mapping capabilities and should support native and offline workflows in first place. By taking a look at the various high performance game engines you will see that most of these are implemented by using native bare to the metal technologies like C and C++, and there are good reasons for doing so. The ArcGIS Runtime developed by Esri Inc. offers a high performance geospatial runtime core being developed in C++. As a software engineer you can use your weapon of choice aka SDK for various technologies for development on Android, iOS, Linux, Windows and using your favorite framework like Java, Swift, Qt and .NET (Framework, Core, UWP, Xamarin). Each of these SDKs are having a specific C-based ABI (Application Binary Interface) for direct access to the geospatial functionalities of the underlying runtime core.

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.

Qt Quick based map viewer sample

Summary

By having a Windows 10 development environment setting up VS 2019 with ArcGIS Runtime SDK for .NET was the easiest one for me — and that is no surprise. Setting up the ArcGIS Runtime SDK for Qt felt quite comfortable and I was expecting some strange qmake or C++ compiler errors — but this time, it just worked out for me. Using Java these days still feels like an island on its own. At least the app just runs by using copy deployment of the OpenJDK, JavaFX and native JNI libraries on my overaged Windows 10 development environment.

Stay tuned for the GEOINT App: Proof of concept part II when we are going to display different web maps and query operational intelligence data.

--

--