Hi, I have tried the sample code available in the below path. It is working fine for the given sample tif file which is in WebMercator coordinate system and also working fine with another tif file (which is also in WebMercator coordinate system). But when trying to use a tif file which is having WGS84 projection, it is not showing any viewshed result during execution. Please suggest.
https://developers.arcgis.com/net/wpf/sample-code/show-interactive-viewshed-with-analysis-overlay/
Hi,
Try to change Map spatial reference to WGS84
// Create a map
MyMapView.Map = new Map(SpatialReferences.Wgs84)
{
// Set initial view point in WGS84
//InitialViewpoint = new Viewpoint(55.610000, -5.200346, 100000)
};
Thanks for the suggestion. Tried modifying the code as suggested. But the issue still persist. Also re-project the sample tif(given below) into WGS84 and tried with that too. But facing the same issue.
https://www.arcgis.com/home/item.html?id=aa97788593e34a32bcaae33947fdc271
Have you updated _observerPosition and etc. which is related to spatial reference?
Yes. It is updated to use MapView's spatial-reference as given below. Also the maximum-radius values is used as 0.01
_observerPosition = new MapPoint(x, y, _observerElevation, mapView.SpatialReference);
There a known limitation in that the ViewshedFunction only works with projected coordinate systems. Passing in a WGS84 based ContinuousField will not work and this will be reported in the AnalysisViewState.
There is however a workaround where you can project your WGS84 data into the coordinate system of your MapView. Take a look at the ContinuousField.CreateAsync method.
When you display the viewshed results in a FieldAnalysis, you need to have created the results in the same spatial reference as your MapView.
We are working on functionality for projecting field data on the GPU for a future release.
Let me know if that helps.