<?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: Calculating offset coordinates of points in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/calculating-offset-coordinates-of-points/m-p/411035#M32406</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Nevermind....figured it out myself but I don't understand why this happens. I only changed the line that creates all six fields and set scale and precision values from 10 to "" and the results are correct. However it is interesting that disp_X and Y fields were calculated correctly even before the change was made.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 22 Dec 2013 11:41:05 GMT</pubDate>
    <dc:creator>GrljAles</dc:creator>
    <dc:date>2013-12-22T11:41:05Z</dc:date>
    <item>
      <title>Calculating offset coordinates of points</title>
      <link>https://community.esri.com/t5/python-questions/calculating-offset-coordinates-of-points/m-p/411033#M32404</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;I have the following problem; I have points feature class that i created from polygons with their coordinates. I would like to calculate for each point the coordinates of the second point at certain distance and at certain angle from the original point. I managed to calculate the offset values for X and Y but I cannot add those values to original coordinates. I was able to do that in ArcMap 10.1 in edit session using calculate field in table however I cannot get python to do the same thing. Python just rounds up the result despite fact that all fields are float.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Here is picture of attribute table where I calculated end_X field with field calculator in ArcMap (that's how I would like the result to loke like) and end_Y field that was calculated using python.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;[ATTACH=CONFIG]30065[/ATTACH]&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;First I tried to do this using cursors (commented out region), after that I opened edit sesion and used calculate field but that also didn't gave the desired result. Here is the relevant part of code:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;rows = arcpy.UpdateCursor(depressionsLocation + centerName, "", depressionsLocation + depressionsName.replace('.shp', '.prj'))
for row in rows:
&amp;nbsp;&amp;nbsp;&amp;nbsp; row.disp_X = (sin(float(row.MBG_Orient))*row.MBG_Length)
&amp;nbsp;&amp;nbsp;&amp;nbsp; rows.updateRow(row)
del row, rows
rows = arcpy.UpdateCursor(depressionsLocation + centerName, "", depressionsLocation + depressionsName.replace('.shp', '.prj'))
for row in rows:
&amp;nbsp;&amp;nbsp;&amp;nbsp; row.disp_Y = (cos(float(row.MBG_Orient))*row.MBG_Length)
&amp;nbsp;&amp;nbsp;&amp;nbsp; rows.updateRow(row)
del row, rows

##rows = arcpy.UpdateCursor(depressionsLocation + centerName, "", depressionsLocation + depressionsName.replace('.shp', '.prj'))
##for row in rows:
##&amp;nbsp;&amp;nbsp;&amp;nbsp; row.end_X = (float(row.X)+float(row.disp_X))
##&amp;nbsp;&amp;nbsp;&amp;nbsp; rows.updateRow(row)
##del row, rows
##rows = arcpy.UpdateCursor(depressionsLocation + centerName, "", depressionsLocation + depressionsName.replace('.shp', '.prj'))
##for row in rows:
##&amp;nbsp;&amp;nbsp;&amp;nbsp; row.end_Y = (float(row.Y)+float(row.disp_Y))
##&amp;nbsp;&amp;nbsp;&amp;nbsp; rows.updateRow(row)
##del row, rows

edit = arcpy.da.Editor(depressionsLocation)

# Edit session is started without an undo/redo stack for versioned data
#&amp;nbsp; (for second argument, use False for unversioned data)
edit.startEditing(False, True)

# Start an edit operation
edit.startOperation()

arcpy.CalculateField_management(centerName, "end_X", '!X! + !disp_X!', "PYTHON")

# Stop the edit operation.
edit.stopOperation()

# Stop the edit session and save the changes
edit.stopEditing(True)&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 22 Dec 2013 10:12:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/calculating-offset-coordinates-of-points/m-p/411033#M32404</guid>
      <dc:creator>GrljAles</dc:creator>
      <dc:date>2013-12-22T10:12:12Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating offset coordinates of points</title>
      <link>https://community.esri.com/t5/python-questions/calculating-offset-coordinates-of-points/m-p/411034#M32405</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Just figured that out, also when I close the edit session in ArcMap and save results the decimal places in table disappear...&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 22 Dec 2013 10:20:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/calculating-offset-coordinates-of-points/m-p/411034#M32405</guid>
      <dc:creator>GrljAles</dc:creator>
      <dc:date>2013-12-22T10:20:39Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating offset coordinates of points</title>
      <link>https://community.esri.com/t5/python-questions/calculating-offset-coordinates-of-points/m-p/411035#M32406</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Nevermind....figured it out myself but I don't understand why this happens. I only changed the line that creates all six fields and set scale and precision values from 10 to "" and the results are correct. However it is interesting that disp_X and Y fields were calculated correctly even before the change was made.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 22 Dec 2013 11:41:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/calculating-offset-coordinates-of-points/m-p/411035#M32406</guid>
      <dc:creator>GrljAles</dc:creator>
      <dc:date>2013-12-22T11:41:05Z</dc:date>
    </item>
  </channel>
</rss>

