StreamLayer for Runtime for Qt

1490
6
Jump to solution
06-09-2021 07:04 AM
maglourenco
New Contributor III

Greetings everyone,

I would like to ask if StreamLayers are available for Runtime for Qt.

I would like to integrate GeoEvent into a mobile app to be potentially developed using Qt.

Thank you.

Tags (3)
0 Kudos
1 Solution

Accepted Solutions
LucasDanzinger
Esri Frequent Contributor

StreamLayers are not currently supported in any of the Runtime SDKs, but we are planning to add support in an upcoming release. Could you provide some details about your organization/project/workflow? Feel free to direct message me with this info if you prefer. I can add this info to our internal epic to help raise the priority of the feature.

View solution in original post

0 Kudos
6 Replies
LucasDanzinger
Esri Frequent Contributor

StreamLayers are not currently supported in any of the Runtime SDKs, but we are planning to add support in an upcoming release. Could you provide some details about your organization/project/workflow? Feel free to direct message me with this info if you prefer. I can add this info to our internal epic to help raise the priority of the feature.

0 Kudos
maglourenco
New Contributor III

Thank you for your response.

We are developing a Decision Support System based on an Android client application that we intend to be offline-enabled (through a local sync-enabled file geodatabase that syncs with a Feature Service), but also with a real-time component where we are exploring the use of GeoEvent or a similar product.

We already developed a simple prototype (without the real-time component) but are still exploring the capabilities of ESRI products to decide the best approach.

Unfortunately, it is looking like the Runtime has some limitations such as not being able to cluster multiple points and now not allowing to add stream layers to visualize real-time data streams.

LucasDanzinger
Esri Frequent Contributor

Good info. Thank you for the details. The StreamLayer limitation could theoretically be temporarily worked around by using a QWebSocket and hooking up to the signals to see when messages are received from the server. This info should contain JSON with the info you would need to create a new Graphic object and place it in the correct location. I tested this many years ago and it worked pretty well with the QML WebSocket type, but unfortunately I haven't tested it recently nor do I have an example to share at the moment.

0 Kudos
maglourenco
New Contributor III

That's a great idea, does that work like a Webhook or is it periodically polling the server? And that is applied to GeoEvent correct? Can it be implemented with AGOL Feature Services too?

Also, do you know if there is any equivalent component or API method on the Runtime SDK for Android?

Thank you very much

0 Kudos
LucasDanzinger
Esri Frequent Contributor

The stream service will have a "subscribe" endpoint. Once you make a connection, you will be subscribed and changes will be pushed down from the service. This differs from a standard http feature service, where you need to explicitly send a request and get a response.

 

Here is some example code in QML, where once active, text messages (JSON) gets pumped through:

import QtQuick 2.6
import QtQuick.Controls 2.2
import Esri.ArcGISRuntime 100.11
import Qt.WebSockets 1.15

ApplicationWindow {
    id: appWindow
    width: 800
    height: 600
    title: "MapStressTest"

    MapView {
        anchors.fill: parent

        Map {
            BasemapTopographicVector{}
        }

        GraphicsOverlay {
            id: go
            SimpleRenderer {
                SimpleMarkerSymbol {
                    color: "red"
                    size: 12
                    style: Enums.SimpleMarkerSymbolStyleCircle
                }
            }
        }
    }

    WebSocket {
        active: true
        url: "wss://<path_to_stream_service>/StreamServer/subscribe"

        onTextMessageReceived: {
            const feat = JSON.parse(message);
            const geometry = ArcGISRuntimeEnvironment.createObject("Point", {
                                                                      x: feat["geometry"]["x"],
                                                                      y: feat["geometry"]["y"],
                                                                      spatialReference: Factory.SpatialReference.createWgs84()
                                                                  });
            const graphic = ArcGISRuntimeEnvironment.createObject("Graphic", {
                                                                      geometry: geometry
                                                                  });
            go.graphics.append(graphic)
        }
    }
}

 

I'm not certain on your question about Android, but I would be very surprised if the Android SDK (the Google SDK, not Esri's Runtime SDK) did not contain a similar web socket API. This should be a pretty standard networking capability for most frameworks to support whether Qt, .NET, iOS, Android, Java, etc.

0 Kudos
maglourenco
New Contributor III

Thank you very much Lucas!

0 Kudos