<?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: How can you get the spatial reference of a map dataframe? in ArcGIS Pro SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-can-you-get-the-spatial-reference-of-a-map/m-p/1278393#M9669</link>
    <description>&lt;P&gt;Thanks Richard! I actually figured it out.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 13 Apr 2023 17:16:33 GMT</pubDate>
    <dc:creator>tzz_12</dc:creator>
    <dc:date>2023-04-13T17:16:33Z</dc:date>
    <item>
      <title>How can you get the spatial reference of a map dataframe?</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-can-you-get-the-spatial-reference-of-a-map/m-p/1278025#M9652</link>
      <description>&lt;P&gt;I was wondering how can I get the spatial reference of the map dataframe? I tried to find the answer searching the online resources with no luck. I appreciate the help. Is it possible to change the spatial reference of the dataframe using C#/ ArcGIS Pro SDK?&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to find out the current spatial reference of the dataframe to create a feature class with an&amp;nbsp;appropriate spatial reference for accurate calculation. If the dataframe does not meet the criteria (e.g. not a projected spatial reference), I want to change it to a&amp;nbsp;appropriate spatial reference.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for your help!&lt;/P&gt;</description>
      <pubDate>Wed, 12 Apr 2023 21:38:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-can-you-get-the-spatial-reference-of-a-map/m-p/1278025#M9652</guid>
      <dc:creator>tzz_12</dc:creator>
      <dc:date>2023-04-12T21:38:26Z</dc:date>
    </item>
    <item>
      <title>Re: How can you get the spatial reference of a map dataframe?</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-can-you-get-the-spatial-reference-of-a-map/m-p/1278039#M9653</link>
      <description>&lt;P&gt;This is actually one of the simpler properties you can get from the map since you do not have to be async or queuedTask.Run.&amp;nbsp; See&amp;nbsp;&lt;A href="https://pro.arcgis.com/en/pro-app/latest/sdk/api-reference/topic11852.html" target="_blank" rel="noopener"&gt;Map Class—ArcGIS Pro&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;var&lt;/SPAN&gt; myMap = MapView.Active;&lt;BR /&gt;SpatialReference mySpatialReference = mapView.Map.SpatialReference;&lt;BR /&gt;if (mySpatialReference.GcsWkid == &lt;SPAN&gt;3857) //if web &lt;/SPAN&gt;Mercator then&lt;BR /&gt;  {&lt;BR /&gt;  //do some work&lt;BR /&gt;   }&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 12 Apr 2023 22:12:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-can-you-get-the-spatial-reference-of-a-map/m-p/1278039#M9653</guid>
      <dc:creator>RichardDaniels</dc:creator>
      <dc:date>2023-04-12T22:12:52Z</dc:date>
    </item>
    <item>
      <title>Re: How can you get the spatial reference of a map dataframe?</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-can-you-get-the-spatial-reference-of-a-map/m-p/1278330#M9664</link>
      <description>&lt;P&gt;In order to change the Spatial Reference for the Map you have to use the SetSpatialReference of the Map class:&amp;nbsp;&lt;A href="https://pro.arcgis.com/en/pro-app/latest/sdk/api-reference/topic11894.html" target="_blank"&gt;SetSpatialReference Method (Map)—ArcGIS Pro.&amp;nbsp;&amp;nbsp;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;For this you have to use QueuedTask.Run:&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;try
{
  // Get the active map view.
  var mapView = MapView.Active;
  if (mapView == null) return;
  // If Spatial Reference is already have Web Mecartor do nothing
  if (mapView.Map.SpatialReference.Equals(SpatialReferences.WebMercator)) return;
  _= QueuedTask.Run(() =&amp;gt;
  {
    // Run within QueuedTask
    mapView.Map.SetSpatialReference(SpatialReferences.WebMercator);
  });
}
catch (Exception ex)
{
  MessageBox.Show (ex.ToString ());
}&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 13 Apr 2023 16:06:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-can-you-get-the-spatial-reference-of-a-map/m-p/1278330#M9664</guid>
      <dc:creator>Wolf</dc:creator>
      <dc:date>2023-04-13T16:06:05Z</dc:date>
    </item>
    <item>
      <title>Re: How can you get the spatial reference of a map dataframe?</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-can-you-get-the-spatial-reference-of-a-map/m-p/1278393#M9669</link>
      <description>&lt;P&gt;Thanks Richard! I actually figured it out.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 13 Apr 2023 17:16:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-can-you-get-the-spatial-reference-of-a-map/m-p/1278393#M9669</guid>
      <dc:creator>tzz_12</dc:creator>
      <dc:date>2023-04-13T17:16:33Z</dc:date>
    </item>
    <item>
      <title>Re: How can you get the spatial reference of a map dataframe?</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-can-you-get-the-spatial-reference-of-a-map/m-p/1278401#M9670</link>
      <description>&lt;P&gt;Thanks Wolf! If the spatial reference isn't Web Mercator, will Line 11 change the spatial reference of the dataframe to Web Mercator?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 13 Apr 2023 17:21:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-can-you-get-the-spatial-reference-of-a-map/m-p/1278401#M9670</guid>
      <dc:creator>tzz_12</dc:creator>
      <dc:date>2023-04-13T17:21:16Z</dc:date>
    </item>
    <item>
      <title>Re: How can you get the spatial reference of a map dataframe?</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-can-you-get-the-spatial-reference-of-a-map/m-p/1278446#M9672</link>
      <description>&lt;P&gt;I am not sure what you mean with dataframe, but this is what my code snippet does:&lt;/P&gt;&lt;P&gt;Before running the code snippet, my Map is using the NAD 1983 spatial reference&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Wolf_0-1681409075042.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/67941i883C509F7EE833F9/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Wolf_0-1681409075042.png" alt="Wolf_0-1681409075042.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;After i run my code snippet that Spatial Reference changed to Web Mercator&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Wolf_1-1681409119702.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/67942i6F16B4B1ED60EEC8/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Wolf_1-1681409119702.png" alt="Wolf_1-1681409119702.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 13 Apr 2023 18:05:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-can-you-get-the-spatial-reference-of-a-map/m-p/1278446#M9672</guid>
      <dc:creator>Wolf</dc:creator>
      <dc:date>2023-04-13T18:05:47Z</dc:date>
    </item>
  </channel>
</rss>

