LineOfSight analysis without SceneView

388
2
09-26-2023 08:52 AM
Labels (1)
radimbachb
New Contributor III

Given a height map in the form of a raster layer I'd like to perfrom LineOfSight analysis on it.

Looking at the sample Line of sight (location) | ArcGIS Maps SDK for Qt | ArcGIS Developers it seems like the SceneView is necessary for this to work and the current viewpoint heavily influences the analysis:
- When zooming out the LineOfSight analysis reports no obstruction.
- When zooming in the analysis reports obstruction.
- When looking away the LineOfSight analysis result is unknown.

Is there a way to uncouple the LineOfSight from the active SceneView, i.e. run it on the given (offline) height map? Or how could one make the LineOfSight analysis independent from the User's current viewpoint?

0 Kudos
2 Replies
KoushikHajra
Esri Contributor

Hello @radimbachb,

Thank you for reaching out to us with your query. You can create a line of sight independently, but in order to view it, you will need to add it to the sceneview. 

To make it independent of the user's current viewpoint, does creating a locationLineOfSight not work for you? You can give it two points and it should give you a line of sight between those two points. However, as the camera distance from the surface increases, the details of the surface gets more generalized and thus the line of sight changes as you are seeing. Again, this is as expected. 

You could use an offline raster elevation source for your surface and run your analysis based on that. Depending on the scale, your analysis might/might not be affected that much. 

I am not sure if that helps. Please feel free to reach out with whatever questions you might have. 

Regards,

Koushik

0 Kudos
radimbachb
New Contributor III

Hi @KoushikHajra, thank you for getting back to me.

If I don't add the LocationLineOfSight to the scene view, i.e. if I don't do this

 

m_analysisOverlay = new AnalysisOverlay(this);
m_sceneView->analysisOverlays()->append(m_analysisOverlay);
m_lineOfSight = new LocationLineOfSight(observerPt, targetPt, this);
m_analysisOverlay->analyses()->append(m_lineOfSight);

 

but instead create the LocationLineOfSight without adding it to the analysis overlay or without adding the analysis overlay to the scene view, then the LocationLineOfSight's targetVisibility is always Unknown. It sems the LocationLineOfSight needs to be attached to the SceneView somehow, otherwise its analysis is never triggered. Or is there a way to trigger the analysis manually?

Is there another way to run a LocationLineOfSight check outside of the User's view point, for example behind the user? This currently always results in TargetVisibility Unknown...

0 Kudos