<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Create Interactive viewshed in ArcGIS Pro SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/create-interactive-viewshed/m-p/1668258#M13272</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;MapView has method&amp;nbsp;&lt;A href="https://pro.arcgis.com/en/pro-app/latest/sdk/api-reference/topic22639.html" target="_self"&gt;&lt;SPAN&gt;AddExploratoryAnalysisAsync&lt;/SPAN&gt;&lt;/A&gt;. Viewshed is derived from&amp;nbsp;ExploratoryAnalysis. Code below:&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;        protected override async void OnClick()
        {
            var mapView = MapView.Active;
            if (mapView == null)
                return;
            var observerPointLayer = mapView.Map.GetLayersAsFlattenedList().OfType&amp;lt;FeatureLayer&amp;gt;().FirstOrDefault(layer =&amp;gt; layer.Name.Equals("ObserverPoint"));
            if (observerPointLayer == null)
                return;

            ExploratoryAnalysis item0 = await QueuedTask.Run(() =&amp;gt; {
                #region Get the observer point
                var observerPtCursor = observerPointLayer.Search();
                MapPoint observerPoint = null; MapPoint targetPoint = null;
                MapPoint observerPointProjected = null;
                while (observerPtCursor.MoveNext())
                {
                    var observerPtFeature = observerPtCursor.Current as Feature;
                    observerPoint = observerPtFeature.GetShape() as MapPoint;
                    observerPointProjected = GeometryEngine.Instance.
                                                  Project(observerPoint, mapView.Map.SpatialReference) as MapPoint;
                }
                #endregion

                Camera camera = new Camera(observerPointProjected.X, observerPointProjected.Y, 10.0, 0, 0);
                Viewshed viewshed = new Viewshed(camera, 0, 180, 100, 1000);
                return viewshed;
            });

            await mapView.AddExploratoryAnalysisAsync(item0);

        }&lt;/LI-CODE&gt;</description>
    <pubDate>Mon, 24 Nov 2025 17:32:39 GMT</pubDate>
    <dc:creator>GKmieliauskas</dc:creator>
    <dc:date>2025-11-24T17:32:39Z</dc:date>
    <item>
      <title>Create Interactive viewshed</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/create-interactive-viewshed/m-p/1668145#M13268</link>
      <description>&lt;P&gt;I would like to create with code something similar to this:&amp;nbsp;&lt;A href="https://pro.arcgis.com/en/pro-app/latest/help/mapping/exploratory-analysis/interactive-viewshed.htm" target="_blank"&gt;https://pro.arcgis.com/en/pro-app/latest/help/mapping/exploratory-analysis/interactive-viewshed.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Using code I can read parameters from file and control the process beter.&lt;/P&gt;&lt;P&gt;I found the Viewshed class that looks like the class I need.&lt;/P&gt;&lt;P&gt;There are no examples I could &amp;nbsp;find.&lt;/P&gt;&lt;P&gt;I could set the Camera properties and the Viewshed properties, but I cannot connect it to any MapView.&lt;/P&gt;&lt;P&gt;The MapView property is read-only. It is null when I run my code and no viewshed is created on screen.&lt;/P&gt;&lt;P&gt;There should be a way to define it but I cannot find it.&lt;/P&gt;&lt;P&gt;I connect my camera into the map (Camera camera = MapView.Active.Camera) then I just updated the properties (x,y, etc) but it did not help.&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Mon, 24 Nov 2025 09:33:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/create-interactive-viewshed/m-p/1668145#M13268</guid>
      <dc:creator>ModyBuchbinder</dc:creator>
      <dc:date>2025-11-24T09:33:23Z</dc:date>
    </item>
    <item>
      <title>Re: Create Interactive viewshed</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/create-interactive-viewshed/m-p/1668258#M13272</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;MapView has method&amp;nbsp;&lt;A href="https://pro.arcgis.com/en/pro-app/latest/sdk/api-reference/topic22639.html" target="_self"&gt;&lt;SPAN&gt;AddExploratoryAnalysisAsync&lt;/SPAN&gt;&lt;/A&gt;. Viewshed is derived from&amp;nbsp;ExploratoryAnalysis. Code below:&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;        protected override async void OnClick()
        {
            var mapView = MapView.Active;
            if (mapView == null)
                return;
            var observerPointLayer = mapView.Map.GetLayersAsFlattenedList().OfType&amp;lt;FeatureLayer&amp;gt;().FirstOrDefault(layer =&amp;gt; layer.Name.Equals("ObserverPoint"));
            if (observerPointLayer == null)
                return;

            ExploratoryAnalysis item0 = await QueuedTask.Run(() =&amp;gt; {
                #region Get the observer point
                var observerPtCursor = observerPointLayer.Search();
                MapPoint observerPoint = null; MapPoint targetPoint = null;
                MapPoint observerPointProjected = null;
                while (observerPtCursor.MoveNext())
                {
                    var observerPtFeature = observerPtCursor.Current as Feature;
                    observerPoint = observerPtFeature.GetShape() as MapPoint;
                    observerPointProjected = GeometryEngine.Instance.
                                                  Project(observerPoint, mapView.Map.SpatialReference) as MapPoint;
                }
                #endregion

                Camera camera = new Camera(observerPointProjected.X, observerPointProjected.Y, 10.0, 0, 0);
                Viewshed viewshed = new Viewshed(camera, 0, 180, 100, 1000);
                return viewshed;
            });

            await mapView.AddExploratoryAnalysisAsync(item0);

        }&lt;/LI-CODE&gt;</description>
      <pubDate>Mon, 24 Nov 2025 17:32:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/create-interactive-viewshed/m-p/1668258#M13272</guid>
      <dc:creator>GKmieliauskas</dc:creator>
      <dc:date>2025-11-24T17:32:39Z</dc:date>
    </item>
    <item>
      <title>Re: Create Interactive viewshed</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/create-interactive-viewshed/m-p/1668398#M13275</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;It is working great - thanks.&lt;/P&gt;&lt;P&gt;There should be a sample or a snippet or at least a line in the help for Viewshed class or&amp;nbsp;&lt;SPAN&gt;ExploratoryAnalysis class.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks again&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Mody&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 25 Nov 2025 09:30:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/create-interactive-viewshed/m-p/1668398#M13275</guid>
      <dc:creator>ModyBuchbinder</dc:creator>
      <dc:date>2025-11-25T09:30:06Z</dc:date>
    </item>
  </channel>
</rss>

