<?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 SpatialReference  differs between ArcGIS Pro and ArcGIS Pro SDK in ArcGIS Pro SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/spatialreference-differs-between-arcgis-pro-and/m-p/1647574#M13107</link>
    <description>&lt;P&gt;I have a filegeodatabase containinig a dataset and some featureclasses.&amp;nbsp;The dataset is originally created with the spatial reference ETRS 1989 UTM Zone 32N.&lt;/P&gt;&lt;P&gt;One of the features in the add-in is to change the spatial reference of this dataset based on some values from a list. The code runs the "Define Projection" tool and the dataset is being updated with the new spatial reference. ETRS 1989 UTM Zone 32N to ETRS 1989 UTRM Zone 33N (or 35N).&lt;/P&gt;&lt;P&gt;When I try to get the spatial reference of one of the featureclasses through ArcGIS Pro SDK:&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;await QueuedTask.Run(() =&amp;gt; 
{
  using (Geodatabase geodatabase = new Geodatabase(new FileGeodatabaseConnectionPath(uri)))
using (FeatureClass featureClass = geodatabase.OpenDataset&amp;lt;FeatureClass&amp;gt;("JSRGrensepunkt"))
{
    var featureclassDefinition = featureClass.GetDefinition();
    var sr = featureclassDefinition.GetSpatialReference();
    /* more code ...*/
});&lt;/LI-CODE&gt;&lt;P&gt;GetSpatialReference() returns the original spatial reference (32N) and not the current one (33N):&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="sr_debug.png" style="width: 443px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/139810iD43279A6C11C5A3F/image-size/large?v=v2&amp;amp;px=999" role="button" title="sr_debug.png" alt="sr_debug.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;If I look at the same featureclass in ArcGIS Pro, I can see that the featureclass indeed is in 33N:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Featureclass Properties.png" style="width: 714px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/139809i969E35287EC887B1/image-size/large?v=v2&amp;amp;px=999" role="button" title="Featureclass Properties.png" alt="Featureclass Properties.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;What might be wrong here?&lt;/P&gt;</description>
    <pubDate>Thu, 04 Sep 2025 06:43:36 GMT</pubDate>
    <dc:creator>TorbjørnDalløkken2</dc:creator>
    <dc:date>2025-09-04T06:43:36Z</dc:date>
    <item>
      <title>SpatialReference  differs between ArcGIS Pro and ArcGIS Pro SDK</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/spatialreference-differs-between-arcgis-pro-and/m-p/1647574#M13107</link>
      <description>&lt;P&gt;I have a filegeodatabase containinig a dataset and some featureclasses.&amp;nbsp;The dataset is originally created with the spatial reference ETRS 1989 UTM Zone 32N.&lt;/P&gt;&lt;P&gt;One of the features in the add-in is to change the spatial reference of this dataset based on some values from a list. The code runs the "Define Projection" tool and the dataset is being updated with the new spatial reference. ETRS 1989 UTM Zone 32N to ETRS 1989 UTRM Zone 33N (or 35N).&lt;/P&gt;&lt;P&gt;When I try to get the spatial reference of one of the featureclasses through ArcGIS Pro SDK:&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;await QueuedTask.Run(() =&amp;gt; 
{
  using (Geodatabase geodatabase = new Geodatabase(new FileGeodatabaseConnectionPath(uri)))
using (FeatureClass featureClass = geodatabase.OpenDataset&amp;lt;FeatureClass&amp;gt;("JSRGrensepunkt"))
{
    var featureclassDefinition = featureClass.GetDefinition();
    var sr = featureclassDefinition.GetSpatialReference();
    /* more code ...*/
});&lt;/LI-CODE&gt;&lt;P&gt;GetSpatialReference() returns the original spatial reference (32N) and not the current one (33N):&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="sr_debug.png" style="width: 443px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/139810iD43279A6C11C5A3F/image-size/large?v=v2&amp;amp;px=999" role="button" title="sr_debug.png" alt="sr_debug.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;If I look at the same featureclass in ArcGIS Pro, I can see that the featureclass indeed is in 33N:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Featureclass Properties.png" style="width: 714px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/139809i969E35287EC887B1/image-size/large?v=v2&amp;amp;px=999" role="button" title="Featureclass Properties.png" alt="Featureclass Properties.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;What might be wrong here?&lt;/P&gt;</description>
      <pubDate>Thu, 04 Sep 2025 06:43:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/spatialreference-differs-between-arcgis-pro-and/m-p/1647574#M13107</guid>
      <dc:creator>TorbjørnDalløkken2</dc:creator>
      <dc:date>2025-09-04T06:43:36Z</dc:date>
    </item>
    <item>
      <title>Re: SpatialReference  differs between ArcGIS Pro and ArcGIS Pro SDK</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/spatialreference-differs-between-arcgis-pro-and/m-p/1647584#M13108</link>
      <description>&lt;P&gt;Define Projection is used when the coordinate system is not known.&amp;nbsp; If you want the data to be in a new coordinate system, then you have to call the Project tool&lt;/P&gt;</description>
      <pubDate>Wed, 03 Sep 2025 12:34:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/spatialreference-differs-between-arcgis-pro-and/m-p/1647584#M13108</guid>
      <dc:creator>DanPatterson</dc:creator>
      <dc:date>2025-09-03T12:34:02Z</dc:date>
    </item>
    <item>
      <title>Re: SpatialReference  differs between ArcGIS Pro and ArcGIS Pro SDK</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/spatialreference-differs-between-arcgis-pro-and/m-p/1647839#M13110</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/215600"&gt;@DanPatterson&lt;/a&gt;&amp;nbsp;Define Projection might also be used if the dataset has a incorrect coordinate system defined &lt;A href="https://pro.arcgis.com/en/pro-app/3.4/tool-reference/data-management/define-projection.htm" target="_blank" rel="noopener"&gt;Define Projection&lt;/A&gt;. At this point in the add-in, there's no data in the dataset or the featureclasses, so the Project tool is not of any use. One workaround as I see it might be to create a new geodatabase and import the correct xml-schema for the coordinatesystem.&lt;/P&gt;</description>
      <pubDate>Thu, 04 Sep 2025 06:42:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/spatialreference-differs-between-arcgis-pro-and/m-p/1647839#M13110</guid>
      <dc:creator>TorbjørnDalløkken2</dc:creator>
      <dc:date>2025-09-04T06:42:44Z</dc:date>
    </item>
    <item>
      <title>Re: SpatialReference  differs between ArcGIS Pro and ArcGIS Pro SDK</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/spatialreference-differs-between-arcgis-pro-and/m-p/1647846#M13111</link>
      <description>&lt;P&gt;correct, I omitted the case of incorrect coordinate system&lt;/P&gt;&lt;P&gt;&lt;A href="https://pro.arcgis.com/en/pro-app/latest/tool-reference/data-management/define-projection.htm" target="_blank"&gt;Define Projection (Data Management)—ArcGIS Pro | Documentation&lt;/A&gt;&lt;/P&gt;&lt;P&gt;and the cases where it can't be used include (in Pro 3.5) are:&lt;/P&gt;&lt;P&gt;The tool does not support the following:&lt;/P&gt;&lt;P&gt;A feature class in an enterprise geodatabase&lt;BR /&gt;A feature class in a feature dataset&lt;BR /&gt;A feature dataset that contains a feature class&lt;/P&gt;&lt;P&gt;As well as several paragraphs clarifying other exemptions and suggests creating a new gdb under some circumstances.&lt;/P&gt;</description>
      <pubDate>Thu, 04 Sep 2025 09:04:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/spatialreference-differs-between-arcgis-pro-and/m-p/1647846#M13111</guid>
      <dc:creator>DanPatterson</dc:creator>
      <dc:date>2025-09-04T09:04:32Z</dc:date>
    </item>
  </channel>
</rss>

