We need to extract height at a point in 3d and this information shall be further used in calculations; since there is a large number of points and further operations are also very lengthy, we need to run these operations in a thread. Please tell if we can extract the heights in a thread. If possible please share a sample code
Hi Geet Bhatia,
Yes, there is a way to do this. Assuming you are in 3D with a SceneView, you can use the Surface object to do this. Better yet, this method is already asynchronous so it will not lock up your main thread for the calculations.
Surface Class | ArcGIS for Developers
Here is a sample that demonstrates how to do this.
Let me know if you're using our Qml Api since that would be a different recommendation.
Hi James
Thanks for the reply.
We are currently using QML for making GUI. But this requirement of extracting heights is not related to GUI. The heights are needed for further calculations. This requirement is pertaining to backend processing. The application shall receive a series of coordinates and GUI has to respond with their corresponding heights. Further GUI shall also tell if these coordinates are present in a particular area (which is present on a vector layer).
That's why I asked if we can access the height information and layer information in a thread.
If there is any sample that extracts the height and accesses the map layer without any intervention of GUI in a thread, please share and please tell the way to do it.
I apologize for the delay in response. Yes, this can be done using Qt's threading capabilities.
QThread Class | Qt Core 5.14.1
QtConcurrent Namespace | Qt Concurrent 5.14.1
The easiest way may be to fire off all your processing via QtConcurrent::run which will run it in another thread. You could, for instance run all of this logic in a separate thread: arcgis-runtime-samples-qt/GetElevationAtPoint.cpp at master · Esri/arcgis-runtime-samples-qt · GitHu...
You could also have a dedicated QThread running that kick off and process all results in that thread. Unfortunately we do not have any samples that demonstrate how to do this type of task in a multithreaded way beyond the async method that the API provides.