<?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: Update existing point geometry to GPS XY via field calculator &amp;amp; python? in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/update-existing-point-geometry-to-gps-xy-via-field/m-p/309170#M24100</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Before testing this, I would recommend making a copy of your feature dataset as a backup.&amp;nbsp; Here is some sample code that will move your point features based on the GPS fields:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;import arcpy
from arcpy import env

env.workspace = "C:/Temp/Python/test.gdb"

fc = "Parker_R6_Manhole_1"

pnt = arcpy.Point()

rows = arcpy.UpdateCursor(fc)
for row in rows:
&amp;nbsp;&amp;nbsp;&amp;nbsp; pnt.X = row.GPS_X
&amp;nbsp;&amp;nbsp;&amp;nbsp; pnt.Y = row.GPS_Y
&amp;nbsp;&amp;nbsp;&amp;nbsp; row.shape = pnt
&amp;nbsp;&amp;nbsp;&amp;nbsp; rows.updateRow(row)

del row, rows&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The tricky part is having the mains move with the manholes.&amp;nbsp; I was able to get this to work by specifying a larger cluster tolerance and setting the rank for the manhole feature class to 1, and the rank for the mains feature class to 2 within the topology.&amp;nbsp; If the distance the points moved is less than the cluster tolerance, the mains will snap to the updated manholes upon validation.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 11 Dec 2021 14:47:22 GMT</pubDate>
    <dc:creator>JakeSkinner</dc:creator>
    <dc:date>2021-12-11T14:47:22Z</dc:date>
    <item>
      <title>Update existing point geometry to GPS XY via field calculator &amp;amp; python?</title>
      <link>https://community.esri.com/t5/python-questions/update-existing-point-geometry-to-gps-xy-via-field/m-p/309169#M24099</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hello - &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you in advance for any help you can offer! &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have a topology between a manhole FC and main lines FC set up so that we can manually snap the existing MH to the new GPS points and have the main lines stay attached.&amp;nbsp; While this works, there are thousands to do and we are looking for a better method.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Using a common manhole ID, I have moved the GPS coordinates into two attribute fields GPS_X and GPS_Y) in the attribute table of the manhole feature class.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Is it possible to update the position of the manhole point with the values in the GPS_X and GPS_Y fields using python and the field calculator (other suggestions welcome)? My hope would be that we could and that the main would follow the "move" of the manhole point due to the topology rules. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have attached a screen shot showing the GPS points (green), the manholes, and main lines.&amp;nbsp; The attribute table shown is that of the manholes.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any other suggestion on how to mass update the locations of the old manholes while moving the attached mains with them would be greatly appreciated!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Sincerely,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Amy&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Aug 2011 21:33:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/update-existing-point-geometry-to-gps-xy-via-field/m-p/309169#M24099</guid>
      <dc:creator>AmyWright_Webber</dc:creator>
      <dc:date>2011-08-08T21:33:13Z</dc:date>
    </item>
    <item>
      <title>Re: Update existing point geometry to GPS XY via field calculator &amp; python?</title>
      <link>https://community.esri.com/t5/python-questions/update-existing-point-geometry-to-gps-xy-via-field/m-p/309170#M24100</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Before testing this, I would recommend making a copy of your feature dataset as a backup.&amp;nbsp; Here is some sample code that will move your point features based on the GPS fields:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;import arcpy
from arcpy import env

env.workspace = "C:/Temp/Python/test.gdb"

fc = "Parker_R6_Manhole_1"

pnt = arcpy.Point()

rows = arcpy.UpdateCursor(fc)
for row in rows:
&amp;nbsp;&amp;nbsp;&amp;nbsp; pnt.X = row.GPS_X
&amp;nbsp;&amp;nbsp;&amp;nbsp; pnt.Y = row.GPS_Y
&amp;nbsp;&amp;nbsp;&amp;nbsp; row.shape = pnt
&amp;nbsp;&amp;nbsp;&amp;nbsp; rows.updateRow(row)

del row, rows&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The tricky part is having the mains move with the manholes.&amp;nbsp; I was able to get this to work by specifying a larger cluster tolerance and setting the rank for the manhole feature class to 1, and the rank for the mains feature class to 2 within the topology.&amp;nbsp; If the distance the points moved is less than the cluster tolerance, the mains will snap to the updated manholes upon validation.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 14:47:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/update-existing-point-geometry-to-gps-xy-via-field/m-p/309170#M24100</guid>
      <dc:creator>JakeSkinner</dc:creator>
      <dc:date>2021-12-11T14:47:22Z</dc:date>
    </item>
    <item>
      <title>Re: Update existing point geometry to GPS XY via field calculator &amp; python?</title>
      <link>https://community.esri.com/t5/python-questions/update-existing-point-geometry-to-gps-xy-via-field/m-p/309171#M24101</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thank you!!&amp;nbsp; This does work quite nicely for moving the existing points to the new GPS coordinates and I am saving it as I know it will come in handy.&amp;nbsp; This would be great to update manhole locations when you have not built your lines yet.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;However, as you pointed out this does not result in the mains moving automatically.&amp;nbsp; Results from increasing the cluster tolerance are mixed at best and each line needs to be reviewed to verify that it is snapped to the correct location.&amp;nbsp; Some of the moves from old to new location are only a few feet but most are more.&amp;nbsp; Since each feature has to be double checked - it is easier to just use the topology tool to move the manhole with the mains attached.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;At this point it looks like we would need to either continue with the manual snapping of each old manhole to the new GPS PT using the topology tool in order to have the mains stay connected or write some custom code to add to what you provided.&amp;nbsp; This additional code would do something like select the end of the line coincident to the manhole and then move the endpoint of that line to the same new GPS location as the manhole.&amp;nbsp; Most pipes are two point lines so this would work in most cases without additional cleanup.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am continueing to experiment with code solutions but in the meantime we are using the Topology to manually move the points with the mains attached since maintains the connectivity.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Suggestions or additional code advice to move the endpoints of the coincident lines are very much appreciated!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks!&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Sincerely&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Amy&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Aug 2011 18:00:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/update-existing-point-geometry-to-gps-xy-via-field/m-p/309171#M24101</guid>
      <dc:creator>AmyWright_Webber</dc:creator>
      <dc:date>2011-08-10T18:00:35Z</dc:date>
    </item>
    <item>
      <title>Re: Update existing point geometry to GPS XY via field calculator &amp; python?</title>
      <link>https://community.esri.com/t5/python-questions/update-existing-point-geometry-to-gps-xy-via-field/m-p/309172#M24102</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Amy,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I looked into updating the polylines using python, but this may not be possible.&amp;nbsp; A &lt;/SPAN&gt;&lt;A href="http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#/Polyline/000v000000n2000000/" rel="nofollow noopener noreferrer" target="_blank"&gt;polyline object's properties&lt;/A&gt;&lt;SPAN&gt; are all read-only.&amp;nbsp; Therefore I could not find a way to write new coordinate values to the end points of the mains.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Something you can do to possibly help you is to write some code to obtain the OBJECTIDs of the mains that need to be moved.&amp;nbsp; This will provide you a list with the feature's end points that are not snapped to a manhole.&amp;nbsp; Ex:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;import arcpy
from arcpy import env

env.overwriteOutput = True
env.workspace = r"C:\Temp\Python\test.gdb"

fc = "swManhole"
fc2 = "swGravityMain"

pnt = arcpy.Point()

# Move Manholes to GPS location
rows = arcpy.UpdateCursor(fc)
for row in rows:
&amp;nbsp;&amp;nbsp;&amp;nbsp; pnt.X = row.POINT_X
&amp;nbsp;&amp;nbsp;&amp;nbsp; pnt.Y = row.POINT_Y
&amp;nbsp;&amp;nbsp;&amp;nbsp; row.shape = pnt
&amp;nbsp;&amp;nbsp;&amp;nbsp; rows.updateRow(row)

del row, rows

# Convert Main endpoints to points feature class
arcpy.FeatureVerticesToPoints_management(fc2, "Main_EndPts", "END")

# Find all Main endpoints within 5 feet of manholes
arcpy.Near_analysis("Main_EndPts", fc, "5")

# Create a layer of all Main endpoints within 5 feet of manholes
lyr = arcpy.MakeFeatureLayer_management("Main_EndPts", "Main_EndPts_Lyr", "NEAR_DIST &amp;gt; 0")

list = []

# Append X &amp;amp; Y values of Main endpoints to list
rows = arcpy.SearchCursor(lyr)
for row in rows:
&amp;nbsp;&amp;nbsp;&amp;nbsp; list.append(float(row.shape.centroid.X) + float(row.shape.centroid.Y))

del row, rows

OBJECTIDs = []

# Find OBJECTIDs of the Mains that need to be moved
rows = arcpy.SearchCursor(fc2)
for row in rows:
&amp;nbsp;&amp;nbsp;&amp;nbsp; geom = row.shape
&amp;nbsp;&amp;nbsp;&amp;nbsp; XY = float(geom.lastPoint.X) + float(geom.lastPoint.Y)
&amp;nbsp;&amp;nbsp;&amp;nbsp; if XY in list:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; OBJECTIDs.append(row.OBJECTID)

del row, rows

arcpy.Delete_management("Main_EndPts")

print OBJECTIDs&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 14:47:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/update-existing-point-geometry-to-gps-xy-via-field/m-p/309172#M24102</guid>
      <dc:creator>JakeSkinner</dc:creator>
      <dc:date>2021-12-11T14:47:25Z</dc:date>
    </item>
    <item>
      <title>Re: Update existing point geometry to GPS XY via field calculator &amp; python?</title>
      <link>https://community.esri.com/t5/python-questions/update-existing-point-geometry-to-gps-xy-via-field/m-p/309173#M24103</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I'm not sure if anyone is still interested in this topic, but I just tried the initial code in this thread after creating a geometric network with my mains and nodes. It updated my point locations and it moved the lines too!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Dillon&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Apr 2012 22:42:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/update-existing-point-geometry-to-gps-xy-via-field/m-p/309173#M24103</guid>
      <dc:creator>DillonFitch</dc:creator>
      <dc:date>2012-04-12T22:42:45Z</dc:date>
    </item>
    <item>
      <title>Re: Update existing point geometry to GPS XY via field calculator &amp; python?</title>
      <link>https://community.esri.com/t5/python-questions/update-existing-point-geometry-to-gps-xy-via-field/m-p/309174#M24104</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Jake,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I need to do exactly what Dillon was wanting to do but not as a standalone Python script. What code would need to be used to perform the same calculation from within the Field Calculator dialog (as depicted in his original attached screenshot)?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any help or suggestions appreciated.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Alan&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Apr 2014 06:49:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/update-existing-point-geometry-to-gps-xy-via-field/m-p/309174#M24104</guid>
      <dc:creator>AlanTonkin</dc:creator>
      <dc:date>2014-04-23T06:49:43Z</dc:date>
    </item>
    <item>
      <title>Re: Update existing point geometry to GPS XY via field calculator &amp; python?</title>
      <link>https://community.esri.com/t5/python-questions/update-existing-point-geometry-to-gps-xy-via-field/m-p/309175#M24105</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Alan,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You can place the code within a function and execute it using the field calculator (right-click on 'Shape' field).&amp;nbsp; Ex:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;def update():
&amp;nbsp; fc = r"C:\temp\python\test.gdb\Vehicle"
&amp;nbsp; pnt = arcpy.Point()
&amp;nbsp; rows = arcpy.UpdateCursor(fc)
&amp;nbsp; for row in rows:
&amp;nbsp;&amp;nbsp;&amp;nbsp; pnt.X = row.GPS_X
&amp;nbsp;&amp;nbsp;&amp;nbsp; pnt.Y = row.GPS_Y
&amp;nbsp;&amp;nbsp;&amp;nbsp; row.shape = pnt
&amp;nbsp;&amp;nbsp;&amp;nbsp; rows.updateRow(row)
&amp;nbsp; del row, rows&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Be sure that you have 'Python' checked at the top of the field calculator, and you will want to specify 'update()' under the Pre-logic script code dialog.&amp;nbsp; Ex:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;[ATTACH=CONFIG]33269[/ATTACH]&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 14:47:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/update-existing-point-geometry-to-gps-xy-via-field/m-p/309175#M24105</guid>
      <dc:creator>JakeSkinner</dc:creator>
      <dc:date>2021-12-11T14:47:28Z</dc:date>
    </item>
    <item>
      <title>Re: Update existing point geometry to GPS XY via field calculator &amp; python?</title>
      <link>https://community.esri.com/t5/python-questions/update-existing-point-geometry-to-gps-xy-via-field/m-p/309176#M24106</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Hi Alan,&lt;BR /&gt;&lt;BR /&gt;You can place the code within a function and execute it using the field calculator.&amp;nbsp; Ex:&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;def update():
&amp;nbsp; fc = r"C:\temp\python\test.gdb\Vehicle"
&amp;nbsp; pnt = arcpy.Point()
&amp;nbsp; rows = arcpy.UpdateCursor(fc)
&amp;nbsp; for row in rows:
&amp;nbsp;&amp;nbsp;&amp;nbsp; pnt.X = row.GPS_X
&amp;nbsp;&amp;nbsp;&amp;nbsp; pnt.Y = row.GPS_Y
&amp;nbsp;&amp;nbsp;&amp;nbsp; row.shape = pnt
&amp;nbsp;&amp;nbsp;&amp;nbsp; rows.updateRow(row)
&amp;nbsp; del row, rows&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;Be sure that you have 'Python' checked at the top of the field calculator, and you will want to specify 'update()' under the Pre-logic script code dialog.&amp;nbsp; Ex:&lt;BR /&gt;&lt;BR /&gt;[ATTACH=CONFIG]33269[/ATTACH]&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Hi Jake,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Many thanks for the response. Can you explain to me why the following python code doesn't work?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have joined my GPS shapefile to my point feature class (Point Z) based on a unique ID field present in both datasets. In the attribute window of my feature class I have 2 features selected (just as a test). I right-click on the &lt;/SPAN&gt;&lt;STRONG&gt;SHAPE&lt;/STRONG&gt;&lt;SPAN&gt; field and choose &lt;/SPAN&gt;&lt;STRONG&gt;Field Calculator&lt;/STRONG&gt;&lt;SPAN&gt;. I change my parser to &lt;/SPAN&gt;&lt;STRONG&gt;Python&lt;/STRONG&gt;&lt;SPAN&gt; and tick Show &lt;/SPAN&gt;&lt;STRONG&gt;Codeblock&lt;/STRONG&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Under the Pre-Logic Script Code, I have the following:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;def SetToGPS( shape,newx,newy &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; point = shape.getPart(0)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; point.X = newx&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; point.Y = newy&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; return point&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;And under the bottom box I have:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;SetToGPS( !mobile.SDE.WaterDevices.SHAPE!, !Gledhow_Devices_Surveyed_By_Andrew2.ArcMapX!, !Gledhow_Devices_Surveyed_By_Andrew2.ArcMapY! )&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This results in a syntax error. In the code that you have suggested, the GPS_X and GPS_Y fields are presumed to be immediate fields in the feature class. In my case they are joined fields, so how do i reference them?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Regards,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Alan&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Edited:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The following worked for me. I had to add immediate fields to the feature class to hold the new X &amp;amp; Y values (GPS_X &amp;amp; GPS_Y) and while the join was still present, calculate these fields with the values from my joined fields. I then removed the join from my feature class and the code below then ran without a problem:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;CODE:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;def Update(newx, newy):&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; pnt = arcpy.Point()&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; pnt.X = newx&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; pnt.Y = newy&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; return pnt&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;SHAPE =&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Update( !GPS_X!, !GPS_Y!)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Jake, maybe you could explain why I couldn't do this while there was still a join present and why it only took immediate fields as input into the function?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 14:47:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/update-existing-point-geometry-to-gps-xy-via-field/m-p/309176#M24106</guid>
      <dc:creator>AlanTonkin</dc:creator>
      <dc:date>2021-12-11T14:47:31Z</dc:date>
    </item>
    <item>
      <title>Re: Update existing point geometry to GPS XY via field calculator &amp; python?</title>
      <link>https://community.esri.com/t5/python-questions/update-existing-point-geometry-to-gps-xy-via-field/m-p/309177#M24107</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;It appears this is a bug, &lt;/SPAN&gt;&lt;A href="http://support.esri.com/en/bugs/nimbus/role/beta10_1/TklNMDk3Mjcz"&gt;NIM097273&lt;/A&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Apr 2014 11:46:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/update-existing-point-geometry-to-gps-xy-via-field/m-p/309177#M24107</guid>
      <dc:creator>JakeSkinner</dc:creator>
      <dc:date>2014-04-23T11:46:26Z</dc:date>
    </item>
    <item>
      <title>Re: Update existing point geometry to GPS XY via field calculator &amp; python?</title>
      <link>https://community.esri.com/t5/python-questions/update-existing-point-geometry-to-gps-xy-via-field/m-p/309178#M24108</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;It appears this is a bug, &lt;A href="http://support.esri.com/en/bugs/nimbus/role/beta10_1/TklNMDk3Mjcz"&gt;NIM097273&lt;/A&gt;.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Hi Jake,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Many thanks for your efforts in helping to resolve this issue. I'm happy to hear that it's a bug and not just something I was doing wrong.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Regards,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Alan&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Apr 2014 14:22:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/update-existing-point-geometry-to-gps-xy-via-field/m-p/309178#M24108</guid>
      <dc:creator>AlanTonkin</dc:creator>
      <dc:date>2014-04-23T14:22:31Z</dc:date>
    </item>
    <item>
      <title>Re: Update existing point geometry to GPS XY via field calculator &amp; python?</title>
      <link>https://community.esri.com/t5/python-questions/update-existing-point-geometry-to-gps-xy-via-field/m-p/309179#M24109</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;This link should work.&lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="http://support.esri.com/en/bugs/nimbus/TklNMDk3Mjcz"&gt;http://support.esri.com/en/bugs/nimbus/TklNMDk3Mjcz&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Apr 2014 15:11:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/update-existing-point-geometry-to-gps-xy-via-field/m-p/309179#M24109</guid>
      <dc:creator>MathewCoyle</dc:creator>
      <dc:date>2014-04-23T15:11:02Z</dc:date>
    </item>
    <item>
      <title>Re: Update existing point geometry to GPS XY via field calculator &amp;amp; python?</title>
      <link>https://community.esri.com/t5/python-questions/update-existing-point-geometry-to-gps-xy-via-field/m-p/309180#M24110</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Alan and Jake,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The Python script works great, but unfortunately I have some Null Values in my GPS Data(we had to digitize some data). Is there any way to use the python script you provided and have it leave all Null or blank values alone? When I use the python script it will remove any points with no GPS data thus I'm losing points, any help would be appreciated thank you!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 Feb 2017 01:12:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/update-existing-point-geometry-to-gps-xy-via-field/m-p/309180#M24110</guid>
      <dc:creator>JeremyJung3</dc:creator>
      <dc:date>2017-02-03T01:12:19Z</dc:date>
    </item>
    <item>
      <title>Re: Update existing point geometry to GPS XY via field calculator &amp;amp; python?</title>
      <link>https://community.esri.com/t5/python-questions/update-existing-point-geometry-to-gps-xy-via-field/m-p/309181#M24111</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="background-color: #ffffff; border: 0px;"&gt;Alan and Jake,&lt;/P&gt;&lt;P style="background-color: #ffffff; border: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="background-color: #ffffff; border: 0px;"&gt;The Python script works great, but unfortunately I have some Null Values in my GPS Data(we had to digitize some data). Is there any way to use the python script you provided and have it leave all Null or blank values alone? When I use the python script it will remove any points with no GPS data thus I'm losing points, any help would be appreciated thank you!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 Feb 2017 01:16:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/update-existing-point-geometry-to-gps-xy-via-field/m-p/309181#M24111</guid>
      <dc:creator>JeremyJung3</dc:creator>
      <dc:date>2017-02-03T01:16:22Z</dc:date>
    </item>
    <item>
      <title>Re: Update existing point geometry to GPS XY via field calculator &amp;amp; python?</title>
      <link>https://community.esri.com/t5/python-questions/update-existing-point-geometry-to-gps-xy-via-field/m-p/309182#M24112</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Before you assign the new X and Y values to the point, just check if they have values.&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; row&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;GPS_X &lt;SPAN class="operator token"&gt;and&lt;/SPAN&gt; row&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;GPS_Y&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="comment token"&gt;# continue processing new XY coordinate&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;else&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="comment token"&gt;# handle null XY coordinate values‍‍‍‍‍‍‍‍&lt;/SPAN&gt;&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;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;EDIT:&lt;/P&gt;&lt;P&gt;Or better yet, use a &lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;where_clause&lt;/SPAN&gt; parameter to just ignore the null values at the very beginning when creating the cursor.&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;where_clause &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"GPS_X is not null and GPS_Y is not null"&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;A class="link-titled" href="http://desktop.arcgis.com/en/arcmap/latest/analyze/arcpy-data-access/updatecursor-class.htm" title="http://desktop.arcgis.com/en/arcmap/latest/analyze/arcpy-data-access/updatecursor-class.htm" rel="nofollow noopener noreferrer" target="_blank"&gt;UpdateCursor—Help | ArcGIS Desktop&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 14:47:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/update-existing-point-geometry-to-gps-xy-via-field/m-p/309182#M24112</guid>
      <dc:creator>BlakeTerhune</dc:creator>
      <dc:date>2021-12-11T14:47:34Z</dc:date>
    </item>
    <item>
      <title>Re: Update existing point geometry to GPS XY via field calculator &amp;amp; python?</title>
      <link>https://community.esri.com/t5/python-questions/update-existing-point-geometry-to-gps-xy-via-field/m-p/309183#M24113</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Blake for the response! But I was wondering how I could write that in a Field Calculator. Currently I'm using this script:&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/316753_pastedImage_1.png" /&gt;&lt;/P&gt;&lt;P&gt;I was wondering how I could write to leave all blank values alone and only calculate points that have a value. Thanks again for any help!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Feb 2017 16:51:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/update-existing-point-geometry-to-gps-xy-via-field/m-p/309183#M24113</guid>
      <dc:creator>JeremyJung3</dc:creator>
      <dc:date>2017-02-07T16:51:46Z</dc:date>
    </item>
    <item>
      <title>Re: Update existing point geometry to GPS XY via field calculator &amp;amp; python?</title>
      <link>https://community.esri.com/t5/python-questions/update-existing-point-geometry-to-gps-xy-via-field/m-p/309184#M24114</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ah, I see. In this case, it would be easiest to simply &lt;A href="http://desktop.arcgis.com/en/arcmap/latest/map/working-with-layers/using-select-by-attributes.htm"&gt;select by attributes&lt;/A&gt; where &lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;GPS_X is not null and GPS_Y is not null&lt;/SPAN&gt;&amp;nbsp;then perform the field calc you have and it will only affect the selected records.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Feb 2017 18:11:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/update-existing-point-geometry-to-gps-xy-via-field/m-p/309184#M24114</guid>
      <dc:creator>BlakeTerhune</dc:creator>
      <dc:date>2017-02-07T18:11:30Z</dc:date>
    </item>
  </channel>
</rss>

