<?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: Python Field Calculator - State Plane to Lat/Long project on the fly? in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/python-field-calculator-state-plane-to-lat-long/m-p/440495#M34502</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Still not getting the results.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;import arcpy&lt;BR /&gt;from arcpy import env&lt;BR /&gt;env.workspace = "C:\Users\rcitkowicz\OneDrive - SJ Industries\SJI Files\MaximoSample_WorkOrders.gdb"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;fc = "WO_POINT"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sr = arcpy.SpatialReference(4326)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;with arcpy.da.UpdateCursor(fc, ["LONG", "LAT", "SHAPE@X", "SHAPE@Y"], "", sr) as cursor:&lt;BR /&gt; for row in cursor:&lt;BR /&gt; row[0] = row[2]&lt;BR /&gt; row[1] = row[3]&lt;BR /&gt; cursor.updateRow(row)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;del cursor&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My LAT/LONG Fields are !POINT_X!&amp;nbsp; !POINT_Y!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Where do I specify this? tried a few spots by no avail.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 13 Jun 2019 19:56:19 GMT</pubDate>
    <dc:creator>RichardCitkowicz1</dc:creator>
    <dc:date>2019-06-13T19:56:19Z</dc:date>
    <item>
      <title>Python Field Calculator - State Plane to Lat/Long project on the fly?</title>
      <link>https://community.esri.com/t5/python-questions/python-field-calculator-state-plane-to-lat-long/m-p/440493#M34500</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Without creating a new feature class to define the projection, I am looking for a way to Field Calculate values to WGS84 Lat/Long from State Plane ft.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The field calculator expression works great but uses the projection of the feature class using this expression !shape.extent.XMax! and !shape.extent.YMax! and adds the state plane feet values into the field specified but I want it to be Lat/Long not feet nor do I not want to create new data nor new fields.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;How can I add the cursor? expression to project on the fly and calculate Lat and Long Values instead of State Plane feet which is what the projection is of the feature class.&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Jun 2019 18:54:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-field-calculator-state-plane-to-lat-long/m-p/440493#M34500</guid>
      <dc:creator>RichardCitkowicz1</dc:creator>
      <dc:date>2019-06-13T18:54:30Z</dc:date>
    </item>
    <item>
      <title>Re: Python Field Calculator - State Plane to Lat/Long project on the fly?</title>
      <link>https://community.esri.com/t5/python-questions/python-field-calculator-state-plane-to-lat-long/m-p/440494#M34501</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can do this by specifying a Geographic Coordinate system.&amp;nbsp; For example WGS 84 has a WKID of 4326.&amp;nbsp; Here is an example of using an update cursor with this projection and updating the lat, long fields:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;import&lt;/SPAN&gt; arcpy
&lt;SPAN class="keyword token"&gt;from&lt;/SPAN&gt; arcpy &lt;SPAN class="keyword token"&gt;import&lt;/SPAN&gt; env
env&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;workspace &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; r&lt;SPAN class="string token"&gt;"C:\temp\python\test.gdb"&lt;/SPAN&gt;

fc &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"vehicles"&lt;/SPAN&gt;

sr &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;SpatialReference&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;4326&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

&lt;SPAN class="keyword token"&gt;with&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;da&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;UpdateCursor&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;fc&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"LONG"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"LAT"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"SHAPE@X"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"SHAPE@Y"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;""&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; sr&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;as&lt;/SPAN&gt; cursor&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
    &lt;SPAN class="keyword token"&gt;for&lt;/SPAN&gt; row &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; cursor&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
        row&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; row&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;2&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;
        row&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;1&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; row&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;3&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;
        cursor&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;updateRow&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;row&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

&lt;SPAN class="keyword token"&gt;del&lt;/SPAN&gt; cursor&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note, to find the WKID you can right-click on the Data Frame &amp;gt; Properties &amp;gt; select the coordinate system &amp;gt; Details:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/450326_pastedImage_1.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 19:42:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-field-calculator-state-plane-to-lat-long/m-p/440494#M34501</guid>
      <dc:creator>JakeSkinner</dc:creator>
      <dc:date>2021-12-11T19:42:25Z</dc:date>
    </item>
    <item>
      <title>Re: Python Field Calculator - State Plane to Lat/Long project on the fly?</title>
      <link>https://community.esri.com/t5/python-questions/python-field-calculator-state-plane-to-lat-long/m-p/440495#M34502</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Still not getting the results.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;import arcpy&lt;BR /&gt;from arcpy import env&lt;BR /&gt;env.workspace = "C:\Users\rcitkowicz\OneDrive - SJ Industries\SJI Files\MaximoSample_WorkOrders.gdb"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;fc = "WO_POINT"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sr = arcpy.SpatialReference(4326)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;with arcpy.da.UpdateCursor(fc, ["LONG", "LAT", "SHAPE@X", "SHAPE@Y"], "", sr) as cursor:&lt;BR /&gt; for row in cursor:&lt;BR /&gt; row[0] = row[2]&lt;BR /&gt; row[1] = row[3]&lt;BR /&gt; cursor.updateRow(row)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;del cursor&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My LAT/LONG Fields are !POINT_X!&amp;nbsp; !POINT_Y!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Where do I specify this? tried a few spots by no avail.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Jun 2019 19:56:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-field-calculator-state-plane-to-lat-long/m-p/440495#M34502</guid>
      <dc:creator>RichardCitkowicz1</dc:creator>
      <dc:date>2019-06-13T19:56:19Z</dc:date>
    </item>
    <item>
      <title>Re: Python Field Calculator - State Plane to Lat/Long project on the fly?</title>
      <link>https://community.esri.com/t5/python-questions/python-field-calculator-state-plane-to-lat-long/m-p/440496#M34503</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Emulate...&lt;/P&gt;&lt;P&gt;&lt;IMG alt="" class="image-1 jive-image" height="614" src="https://community.esri.com/legacyfs/online/450304_field_calc03.png" width="444" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Jun 2019 19:59:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-field-calculator-state-plane-to-lat-long/m-p/440496#M34503</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2019-06-13T19:59:20Z</dc:date>
    </item>
    <item>
      <title>Re: Python Field Calculator - State Plane to Lat/Long project on the fly?</title>
      <link>https://community.esri.com/t5/python-questions/python-field-calculator-state-plane-to-lat-long/m-p/440497#M34504</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Replace &lt;STRONG&gt;LONG&lt;/STRONG&gt; and &lt;STRONG&gt;LAT&lt;/STRONG&gt; in the following line with &lt;STRONG&gt;POINT_X &lt;/STRONG&gt;and &lt;STRONG&gt;POINT_Y:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="language-python line-numbers"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;with&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;da&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;UpdateCursor&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;fc&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"LONG"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"LAT"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"SHAPE@X"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"SHAPE@Y"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;""&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; sr&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;as&lt;/SPAN&gt; cursor&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Should be:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="language-python line-numbers"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;with&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;da&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;UpdateCursor&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;fc&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"POINT_X"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"POINT_Y"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"SHAPE@X"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"SHAPE@Y"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;""&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; sr&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;as&lt;/SPAN&gt; cursor&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Jun 2019 20:00:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-field-calculator-state-plane-to-lat-long/m-p/440497#M34504</guid>
      <dc:creator>JakeSkinner</dc:creator>
      <dc:date>2019-06-13T20:00:34Z</dc:date>
    </item>
  </channel>
</rss>

