<?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 Move (shift) polylines in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/move-shift-polylines/m-p/272077#M21020</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Someone could help me with a python script or something to move (shitfing) polylines through the x-axis and y axis&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I can do this task manually in an edit session in ArcMap 10, using the "Move.." Command (Delta X, Y) in Toolbar Editor. But the idea is to automate this because it is part of a larger model.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Please anyone help me?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks a million!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 18 Aug 2011 20:00:48 GMT</pubDate>
    <dc:creator>EdwardChonón</dc:creator>
    <dc:date>2011-08-18T20:00:48Z</dc:date>
    <item>
      <title>Move (shift) polylines</title>
      <link>https://community.esri.com/t5/python-questions/move-shift-polylines/m-p/272077#M21020</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Someone could help me with a python script or something to move (shitfing) polylines through the x-axis and y axis&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I can do this task manually in an edit session in ArcMap 10, using the "Move.." Command (Delta X, Y) in Toolbar Editor. But the idea is to automate this because it is part of a larger model.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Please anyone help me?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks a million!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Aug 2011 20:00:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/move-shift-polylines/m-p/272077#M21020</guid>
      <dc:creator>EdwardChonón</dc:creator>
      <dc:date>2011-08-18T20:00:48Z</dc:date>
    </item>
    <item>
      <title>Re: Move (shift) polylines</title>
      <link>https://community.esri.com/t5/python-questions/move-shift-polylines/m-p/272078#M21021</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Your best bet is to do this automation with a cursor.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Check out &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;* Update cursor - &lt;/SPAN&gt;&lt;A href="http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//000v0000003m000000.htm" rel="nofollow noopener noreferrer" target="_blank"&gt;http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//000v0000003m000000.htm&lt;/A&gt;&lt;BR /&gt;&lt;SPAN&gt;* Working with geometry - &lt;/SPAN&gt;&lt;A href="http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#/Working_with_geometry_in_Python/002z0000001s000000/" rel="nofollow noopener noreferrer" target="_blank"&gt;http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#/Working_with_geometry_in_Python/002z0000001s000000/&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I haven't tested this, but you will do something like:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
shapeField = arcpy.Describe("Feature Class").ShapeFieldName
deltaX = 10
deltaY = 10

c = arcpy.UpdateCursor("Feature Class")
for row in c:
&amp;nbsp;&amp;nbsp;&amp;nbsp; partnum = 0
&amp;nbsp;&amp;nbsp;&amp;nbsp; feat = row.getValue(shapefieldname)
&amp;nbsp;&amp;nbsp;&amp;nbsp; for part in feat:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for pnt in feat.getPart(partnum):
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pnt.X = pnt.X + deltaX
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pnt.Y = pnt.Y + deltaY
&amp;nbsp;&amp;nbsp;&amp;nbsp; c.updateRow(row)
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 13:17:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/move-shift-polylines/m-p/272078#M21021</guid>
      <dc:creator>ChristopherFricke1</dc:creator>
      <dc:date>2021-12-11T13:17:23Z</dc:date>
    </item>
    <item>
      <title>Re: Move (shift) polylines</title>
      <link>https://community.esri.com/t5/python-questions/move-shift-polylines/m-p/272079#M21022</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hello Christoph, thank you very much for your prompt response, I tried your code is executed, but the only thing that happens is that the attribute table is cleared, but the polylines are not moved, I attached the code I used you.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Displacement coordinates are not equal to x and y.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I enclose the shapefile with which I am doing the tests.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you very much for your support, I'm checking the links you sent me help, but would appreciate very much your help with this issue.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Many thanks&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Edward&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;import arcpy
shapeField = arcpy.Describe(r"C:\2011\ACCESOS\accesos_yan_loc_psad56.shp").ShapeFieldName
deltaX = 10
deltaY = 10

c = arcpy.UpdateCursor(r"C:\2011\ACCESOS\accesos_yan_loc_psad56.shp")
for row in c:
&amp;nbsp;&amp;nbsp;&amp;nbsp; partnum = 0
&amp;nbsp;&amp;nbsp;&amp;nbsp; feat = row.getValue(shapeField)
&amp;nbsp;&amp;nbsp;&amp;nbsp; for part in feat:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for pnt in feat.getPart(partnum):
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pnt.X = pnt.X + deltaX
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pnt.Y = pnt.Y + deltaY
&amp;nbsp;&amp;nbsp;&amp;nbsp; c.updateRow(row)&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 13:17:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/move-shift-polylines/m-p/272079#M21022</guid>
      <dc:creator>EdwardChonón</dc:creator>
      <dc:date>2021-12-11T13:17:26Z</dc:date>
    </item>
    <item>
      <title>Re: Move (shift) polylines</title>
      <link>https://community.esri.com/t5/python-questions/move-shift-polylines/m-p/272080#M21023</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;How about simply projecting your data with an altered false easting and false northing? Then define the prj of your altered dataset to be that of the original prj. You can programatically create/alter projection definitions though the gp/arcpy object.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Aug 2011 17:33:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/move-shift-polylines/m-p/272080#M21023</guid>
      <dc:creator>ChrisSnyder</dc:creator>
      <dc:date>2011-08-22T17:33:34Z</dc:date>
    </item>
  </channel>
</rss>

