<?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: Arcpy Updatecursor not using normal LAT LONG units in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/arcpy-updatecursor-not-using-normal-lat-long-units/m-p/1384115#M69916</link>
    <description>&lt;P&gt;That's supposed to be 2, not 1. A spelling error due to trying to get the post to show the code with proper indentation. It's been corrected.&lt;/P&gt;&lt;P&gt;The code finds the row with a "bhid" of 1175. It then updates the &lt;A href="mailto:SHAPE@X" target="_blank"&gt;SHAPE@X &lt;/A&gt;and Y, but the numbers are being interpreted as non-DD. It's some weird coordinate system.&lt;/P&gt;&lt;P&gt;The spatial reference of the layer in a file gdb is "WGS 1984 Web Mercator (auxiliary sphere)", geographic coordinate system "WGS 1984".&lt;/P&gt;</description>
    <pubDate>Mon, 19 Feb 2024 21:12:20 GMT</pubDate>
    <dc:creator>JJGFMO</dc:creator>
    <dc:date>2024-02-19T21:12:20Z</dc:date>
    <item>
      <title>Arcpy Updatecursor not using normal LAT LONG units</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-updatecursor-not-using-normal-lat-long-units/m-p/1384086#M69912</link>
      <description>&lt;P&gt;I am trying to update a points lat long. Instead of placing the point at LAT 50, LONG 50, it's updating the point to just barely off from 0,0 (0.0004492, 0.0004492). This works as expected on another machine. I suspect there is some spatial reference that needs to be set. How do I do that?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;import arpy&lt;/P&gt;&lt;P&gt;inFeatures = &amp;lt;points layer location&amp;gt;&lt;/P&gt;&lt;P&gt;with arcpy.da.UpdateCursor(inFeatures, ["SHAPE@X","SHAPE@Y", "bhid"]) as cursor:&lt;BR /&gt;for row in cursor:&lt;BR /&gt;if row[2] == "1175":&lt;BR /&gt;print(row[0])&lt;BR /&gt;print(row[1])&lt;BR /&gt;row[0] = 50&lt;BR /&gt;row[1] = 50&lt;/P&gt;&lt;P&gt;cursor.updateRow(row)&lt;/P&gt;</description>
      <pubDate>Mon, 19 Feb 2024 21:13:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-updatecursor-not-using-normal-lat-long-units/m-p/1384086#M69912</guid>
      <dc:creator>JJGFMO</dc:creator>
      <dc:date>2024-02-19T21:13:27Z</dc:date>
    </item>
    <item>
      <title>Re: Arcpy Updatecursor not using normal LAT LONG units</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-updatecursor-not-using-normal-lat-long-units/m-p/1384102#M69915</link>
      <description>&lt;P&gt;We need a bit more information.&amp;nbsp; For example, the feature class the cursor is updating already has a spatial reference, or it should, so what is it?&amp;nbsp; Also, the logic of the code snippet doesn't make sense because if you are working with latitude and longitude, how will you ever get a latitude of "1175"?&amp;nbsp; (See line:&amp;nbsp; if row[1] == "1175").&lt;/P&gt;</description>
      <pubDate>Mon, 19 Feb 2024 20:21:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-updatecursor-not-using-normal-lat-long-units/m-p/1384102#M69915</guid>
      <dc:creator>JoshuaBixby</dc:creator>
      <dc:date>2024-02-19T20:21:43Z</dc:date>
    </item>
    <item>
      <title>Re: Arcpy Updatecursor not using normal LAT LONG units</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-updatecursor-not-using-normal-lat-long-units/m-p/1384115#M69916</link>
      <description>&lt;P&gt;That's supposed to be 2, not 1. A spelling error due to trying to get the post to show the code with proper indentation. It's been corrected.&lt;/P&gt;&lt;P&gt;The code finds the row with a "bhid" of 1175. It then updates the &lt;A href="mailto:SHAPE@X" target="_blank"&gt;SHAPE@X &lt;/A&gt;and Y, but the numbers are being interpreted as non-DD. It's some weird coordinate system.&lt;/P&gt;&lt;P&gt;The spatial reference of the layer in a file gdb is "WGS 1984 Web Mercator (auxiliary sphere)", geographic coordinate system "WGS 1984".&lt;/P&gt;</description>
      <pubDate>Mon, 19 Feb 2024 21:12:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-updatecursor-not-using-normal-lat-long-units/m-p/1384115#M69916</guid>
      <dc:creator>JJGFMO</dc:creator>
      <dc:date>2024-02-19T21:12:20Z</dc:date>
    </item>
    <item>
      <title>Re: Arcpy Updatecursor not using normal LAT LONG units</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-updatecursor-not-using-normal-lat-long-units/m-p/1384135#M69917</link>
      <description>&lt;P&gt;&lt;SPAN&gt;&lt;A href="https://epsg.io/3857" target="_self"&gt;WGS 1984 Web Mercator (auxiliary sphere)&lt;/A&gt; is a projected coordinate system that uses metres as the units, not longitude/latitude.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Try setting an output spatial reference.&lt;/SPAN&gt;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;with arcpy.da.UpdateCursor(inFeatures, ["SHAPE@X","SHAPE@Y", "bhid"], spatial_reference=arcpy.SpatialReference(4326)) as cursor:
    for row in cursor:
        etc...&lt;/LI-CODE&gt;</description>
      <pubDate>Mon, 19 Feb 2024 21:54:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-updatecursor-not-using-normal-lat-long-units/m-p/1384135#M69917</guid>
      <dc:creator>Luke_Pinner</dc:creator>
      <dc:date>2024-02-19T21:54:36Z</dc:date>
    </item>
    <item>
      <title>Re: Arcpy Updatecursor not using normal LAT LONG units</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-updatecursor-not-using-normal-lat-long-units/m-p/1384535#M69922</link>
      <description>&lt;P&gt;Thanks, Luke_Pinner. This is exactly what I was looking for. My mistake was thinking that WGS 1984 (WKID 4326) was the same as WGS 1984 Web Mercator.&lt;/P&gt;</description>
      <pubDate>Tue, 20 Feb 2024 19:08:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-updatecursor-not-using-normal-lat-long-units/m-p/1384535#M69922</guid>
      <dc:creator>JJGFMO</dc:creator>
      <dc:date>2024-02-20T19:08:17Z</dc:date>
    </item>
  </channel>
</rss>

