<?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 Apply datum tranformation only if source datum is different than target in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/apply-datum-tranformation-only-if-source-datum-is/m-p/1110404#M62769</link>
    <description>&lt;P&gt;I'm trying to create a simple evaluation within a script which does not restrict the spatial reference of the data, but the output is fixed: WGS 1983 Web Mercator Aux Sphere. All inputs will be projected data.&lt;/P&gt;&lt;P&gt;I want to project any input data to match the desired output projection, but I need to evaluate the datum of the input vs the output. .&lt;/P&gt;&lt;P&gt;Unfortunately, according to the &lt;A href="https://pro.arcgis.com/en/pro-app/latest/arcpy/classes/spatialreference.htm" target="_self"&gt;documentation found here&lt;/A&gt;, this property (GCSName) is available only for geographic data. However:&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;Because a projected coordinate system is based on a geographic coordinate system, projected coordinate system properties can be accessed from a geographic coordinate system via the &lt;SPAN class=""&gt;GCS&lt;/SPAN&gt; property.&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;But the GCS property returns a spatial reference object for which I do not know how to format or parse parameters from to evaluate. Is there a way to do this? This will eventually be rolled-up into a script tool.&lt;/P&gt;&lt;P&gt;Any general tips on handling such a process would be greatly appreciated. I anticipate there will only be a handful of input PCS to deal with but it is entirely possible that there both NAD83 &amp;amp; WGS84 datums (3 feet matters for us in this case!).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 22 Oct 2021 19:49:07 GMT</pubDate>
    <dc:creator>ZacharyHart</dc:creator>
    <dc:date>2021-10-22T19:49:07Z</dc:date>
    <item>
      <title>Apply datum tranformation only if source datum is different than target</title>
      <link>https://community.esri.com/t5/python-questions/apply-datum-tranformation-only-if-source-datum-is/m-p/1110404#M62769</link>
      <description>&lt;P&gt;I'm trying to create a simple evaluation within a script which does not restrict the spatial reference of the data, but the output is fixed: WGS 1983 Web Mercator Aux Sphere. All inputs will be projected data.&lt;/P&gt;&lt;P&gt;I want to project any input data to match the desired output projection, but I need to evaluate the datum of the input vs the output. .&lt;/P&gt;&lt;P&gt;Unfortunately, according to the &lt;A href="https://pro.arcgis.com/en/pro-app/latest/arcpy/classes/spatialreference.htm" target="_self"&gt;documentation found here&lt;/A&gt;, this property (GCSName) is available only for geographic data. However:&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;Because a projected coordinate system is based on a geographic coordinate system, projected coordinate system properties can be accessed from a geographic coordinate system via the &lt;SPAN class=""&gt;GCS&lt;/SPAN&gt; property.&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;But the GCS property returns a spatial reference object for which I do not know how to format or parse parameters from to evaluate. Is there a way to do this? This will eventually be rolled-up into a script tool.&lt;/P&gt;&lt;P&gt;Any general tips on handling such a process would be greatly appreciated. I anticipate there will only be a handful of input PCS to deal with but it is entirely possible that there both NAD83 &amp;amp; WGS84 datums (3 feet matters for us in this case!).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 22 Oct 2021 19:49:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/apply-datum-tranformation-only-if-source-datum-is/m-p/1110404#M62769</guid>
      <dc:creator>ZacharyHart</dc:creator>
      <dc:date>2021-10-22T19:49:07Z</dc:date>
    </item>
    <item>
      <title>Re: Apply datum tranformation only if source datum is different than target</title>
      <link>https://community.esri.com/t5/python-questions/apply-datum-tranformation-only-if-source-datum-is/m-p/1110435#M62770</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;in_fc = r"C:\Git_Dan\npgeom_bak\Project_npg\npgeom.gdb\Ontario_singlepart"
sr = arcpy.Describe(in_fc).spatialReference

sr.name
'NAD_1983_Statistics_Canada_Lambert'

sr.exportToString()
'PROJCS["NAD_1983_Statistics_Canada_Lambert",
        GEOGCS["GCS_North_American_1983",
        DATUM["D_North_American_1983",
        SPHEROID["GRS_1980",6378137.0,298.257222101]],
        PRIMEM["Greenwich",0.0],
        UNIT["Degree",0.0174532925199433]],
 PROJECTION["Lambert_Conformal_Conic"],
 PARAMETER["False_Easting",6200000.0],
 PARAMETER["False_Northing",3000000.0],
 PARAMETER["Central_Meridian",-91.86666666666666],
 PARAMETER["Standard_Parallel_1",49.0],
 PARAMETER["Standard_Parallel_2",77.0],
 PARAMETER["Latitude_Of_Origin",63.390675],
 UNIT["Meter",1.0]];-28455800 -28572600 10000;-100000 10000;-100000 
 10000;0.001;0.001;0.001;IsHighPrecision'&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;There are easier ways to get at the information, but every projected coordinate system has a root GCS and hence a datum associated with (lines 9 and 10).&amp;nbsp; You just have to sift through the properties&lt;/P&gt;&lt;P&gt;&lt;A href="https://pro.arcgis.com/en/pro-app/latest/arcpy/classes/spatialreference.htm" target="_blank" rel="noopener"&gt;SpatialReference—ArcGIS Pro | Documentation&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 22 Oct 2021 21:42:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/apply-datum-tranformation-only-if-source-datum-is/m-p/1110435#M62770</guid>
      <dc:creator>DanPatterson</dc:creator>
      <dc:date>2021-10-22T21:42:08Z</dc:date>
    </item>
    <item>
      <title>Re: Apply datum tranformation only if source datum is different than target</title>
      <link>https://community.esri.com/t5/python-questions/apply-datum-tranformation-only-if-source-datum-is/m-p/1110439#M62771</link>
      <description>&lt;P&gt;Thanks Dan! That's the same doc I linked to as well. I'm able to generate the string, but are the items in the Spatial Reference object indexed so I can parse them out? Are they keyed? The documentation isn't very detailed.&lt;/P&gt;&lt;P&gt;Thanks again, you do so much for us!&lt;/P&gt;</description>
      <pubDate>Fri, 22 Oct 2021 21:54:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/apply-datum-tranformation-only-if-source-datum-is/m-p/1110439#M62771</guid>
      <dc:creator>ZacharyHart</dc:creator>
      <dc:date>2021-10-22T21:54:40Z</dc:date>
    </item>
    <item>
      <title>Re: Apply datum tranformation only if source datum is different than target</title>
      <link>https://community.esri.com/t5/python-questions/apply-datum-tranformation-only-if-source-datum-is/m-p/1110466#M62772</link>
      <description>&lt;P&gt;for my example&lt;/P&gt;&lt;LI-CODE lang="python"&gt;sr.GCS
&amp;lt;geoprocessing spatial reference object at 0x243ed372af0&amp;gt;

sr.GCS.name
'GCS_North_American_1983'&lt;/LI-CODE&gt;&lt;P&gt;instead of parsing the whole string&lt;/P&gt;</description>
      <pubDate>Sat, 23 Oct 2021 00:34:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/apply-datum-tranformation-only-if-source-datum-is/m-p/1110466#M62772</guid>
      <dc:creator>DanPatterson</dc:creator>
      <dc:date>2021-10-23T00:34:50Z</dc:date>
    </item>
    <item>
      <title>Re: Apply datum tranformation only if source datum is different than target</title>
      <link>https://community.esri.com/t5/python-questions/apply-datum-tranformation-only-if-source-datum-is/m-p/1110795#M62777</link>
      <description>&lt;P&gt;that works, thanks!! i'm off to the races now.&lt;/P&gt;</description>
      <pubDate>Mon, 25 Oct 2021 12:55:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/apply-datum-tranformation-only-if-source-datum-is/m-p/1110795#M62777</guid>
      <dc:creator>ZacharyHart</dc:creator>
      <dc:date>2021-10-25T12:55:17Z</dc:date>
    </item>
  </channel>
</rss>

