GEOINT App: Using web maps as the spatial ground truth.
By: Jan Tschada
Tags: Dotnet, Geospatial, Qt, Java, Software Engineering

The Web Map Use Case

Loading a web map can sometimes take a while and should therefore be carried out in the background. ArcGIS Runtime supports the so-called loadable design pattern. Accessing web maps and operational data structured in layers requires the resources to initialize their state asynchronously. The loadable design pattern reflects the behavior that online resources use to load data asynchronously. The pattern also provides a retry mechanism if previous attempts to load have failed so we can properly handle and resolve situations such as network outtakes. Online resources process simultaneous and repeated requests for loading accordingly and also allow a request to be canceled so that we can stop the loading of a resource.

The ACLED events are represented as two feature layers of this web map. Both feature layers represent the events as data records, so called features. One contains the events of the last 14 days and the other all historical events. The events are visualized by a specific unique value and a simple renderer. An event feature has a unique primary key and a point geometry. All features of a feature layer always have the same geometry type and the same spatial reference. This restriction not only has advantages in terms of rendering performance, but also in evaluating the features. It also allows to spatially relate the features to one another in a simple manner.

When querying the features you have to make sure that the corresponding layer is fully loaded first. You get access to the attributes and geometries of every feature. A query can not only filter the resulting feature set, but also define which attributes and whether or not the geometries should be returned.

After investigating a bunch of ACLED items from the Living atlas we took a closer look at one of the items the “Bureau of Conflict and Stabilization Operations” (CSO) published in 2019. The web map was last updated on December 4th in 2019 and can be easily accessed using this item.

If we reuse the examples from Proof of concept — Ramp-up, we just have to replace the default map by using the item. We need to create a new portal item instance using the item’s url and passing this instance into the constructor of the map instance. Compile, run the sample map viewer and after the web map is loaded we should see a ACLED layer showing on top of a dark-gray basemap.

JavaFX based ACLED web map sample

WPF based ACLED web map sample

Qt Quick based ACLED web map sample

Each SDK uses the language specific best practices for getting the job done. In Java you create and register a listener using the map or layer instance. When developing with C# you do the same, the listener is just called an event handler and you can enjoy the async/await pattern. In Qt you are using the specific signals and define slots for handling the map and layer events.

We defined a simple use case for stressing the map viewer samples. When the map is fully loaded we just register a map view tap listener/handler/slot. By tapping the map view a query is scheduled against the feature layer representing the ACLED events. The returned result is analyzed by using the primary key and the returned geometry of each feature. The map sample viewer defines a generic Hastable/Dictionary/Hash managing all returned features using the ID as key and the feature itself as value. Whenever a new query result is obtained, the feature is only added when the ID is not already known and if the ID is known the geometries of both features are compared using the underlying Geometry Engine implementation of the C++ based runtime core. If the geometry had changed, the old feature is replaced by the new feature. The feature layer contains 13 684 features all having a valid and not empty geometry representation. When analyzing the point geometries by just using their raw coordinates we saw that 6301 unique locations were represented by those features. If we want to know the real spatial distribution of these ACLED events, we would create a spatial grid and classify locations being near to each other as a match.

Let us take a look at the following chart representing the overall memory consumption of all three sample map viewers during startup and on shutdown.