Hi,
Background: Working in ArcGIS Runtime for QT version 100.8 in QT version 5.14 on an Ubuntu system running release 19.10.
I've got a KML GroundOverlay graphic whose position I'd like to update in real-time. The graphic is rendered just fine initially, but any subsequent calls to functions on the KmlGroundOverlay don't seem to have an effect. As an example, here's a bit of code:
Considering the variables:
Esri::ArcGISRuntime::KmlGroundOverlay * m_groundOverlay; Esri::ArcGISRuntime::KmlDataset *m_kdata; Esri::ArcGISRuntime::KmlLayer *m_klayer; Esri::ArcGISRuntime::Map *m_map;
In the "before" code - before the KML is called:
m_map(new Map(Basemap::topographicVector(this), this));
Setting up the KML Ground Overlay:
const Envelope env(-.001, 0.001, .001, 0.00, SpatialReference::wgs84()); KmlIcon * kmlIcon = new KmlIcon(QUrl("/home/bcrist/hundySquare.png")); // "hundySquare.png" is a red square shaped image file // Create Overlay m_groundOverlay = new Esri::ArcGISRuntime::KmlGroundOverlay(env, kmlIcon, this); // Create Dataset m_kdata = new Esri::ArcGISRuntime::KmlDataset(m_groundOverlay, this); // Create Layer m_klayer = new Esri::ArcGISRuntime::KmlLayer(m_kdata, this); m_map->operationalLayers()->append(m_klayer);
Subsequently trying to just spin the layer around via a timer-called separate function (for testing purposes, obviously):
m_groundOverlay->setRotation(m_groundOverlay->rotation() + 1); if (m_groundOverlay->rotation() > 360) { m_groundOverlay->setRotation(0); }
I've assembled the "EditKmlGroundOverlay" sample from the arcgis-runtime-samples-qt repo on Git and altered it do perform the rotation above, and it works fine. The only difference I can figure out is that the EditKmlGroundOverlay sample uses a scene view instead of a map view.
Is this a limitation of Map Views or am I doing something wrong or missing something?
Hi Brian,
This is a limitation with GroundOverlays with the currently released software - these properties can be modified but do not show up properly in the MapView. As you noticed with the sample, everything should work as expected in the SceneView.
Hi Lucas,
Thanks for the answer! So this sort of leads to a bigger question I suppose. Should I be leaning more towards implementing a Scene View instead of a Map View for something that is visualizing, say, vehicles whose positions are being updated regularly? I.e. are scenes generally a better idea for implementations that require a lot of real-time updating?
Regards,
Brian
No, I wouldn't say that necessarily. This is just one particular bug we have in our implementation of KML.
Thanks Lucas,
So the issue behind all of this KML that I'm trying to resolve is actually this: My application has a video stream; call it a stream of QImages coming from an sensor. The images are known to be a certain real-world size, which is also fed to my application from the sensor.
I need to render these QImages at their "real world" size on the map. I posted earlier in the year and was suggested a KmlGroundOverlay / Envelope whose size is created from those data coming from the sensor. But if real-time updates aren't going to happen on a KmlGroundOverlay in MapView, I need to come up with another solution...
The obvious seeming one to me is to use a PictureMarkerSymbol and setting an overlay's setScaleSymbols flag to true. But I rapidly run into my limits of GIS understanding when I try to do this... I end up rendering things in near-to-real-size not cannot figure out how to render them in actual-real-size on the map. I don't understand the relationship between the viewPortScale and the map's referenceScale and how to set these values to be able to, say, make a 100m x 100m square.
Is there a way to make a PictureFillSymbol do its thing without tiling the source image?
Any suggestions on working around the KML updates would be greatly appreciated.
I see. Since that solution was discussed, we released a newer API designed for a very similar use case you are mentioning. It is for the ImageOverlay, which was designed to take real time images from radar/sensors and display rapidly. This currently only works in 3D since that was the initial requirement, but we are aiming to bring this to 2D at some point. Can you try out this sample? You'll need to change the .pro file's runtime version to 100.8, as this is part of our development branch currently (v.next branch) - arcgis-runtime-samples-qt/ArcGISRuntimeSDKQt_CppSamples/Scenes/AnimateImagesWithImageOverlay at v.ne...
Hi Lucas,
Yes that built fine with 100.8, but I could not find the animation (3D/ImageOverlay/PacificSouthWest) - is it someone online for download?
And the key is that we're on a Map/MapGraphicsView and would prefer not to go to a Scene View for a few reasons. But the ImageOverlay would be absolutely perfect for what we're trying to accomplish (if it worked in a Map/MapGraphicsView!)
Regards,
Brian
Here is the data - https://www.arcgis.com/home/item.html?id=9465e8c02b294c69bdb42de056a23ab1
If possible, could you email me some details about your org, project, requirements, etc? That would help gain justification for getting this running in 2D - ldanzinger@esri.com
Thank you for the data, it looks awesome.
I will email you more details about the project and organization. Thanks so much for all of your help.
I'm on the East Coast, so I'll probably email first thing in the morning (8/11/20)
Hi Lucas,
I emailed on Tuesday morning and never heard back. Please advise on the status; did you receive my email? Any ideas?
Regards,
Brian