<?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 Can I place a line on a point using an attribute for the angle? in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/can-i-place-a-line-on-a-point-using-an-attribute/m-p/553828#M43258</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a set of points that I need to label in another software that has very limited labeling capabilities. We really need to be able to rotate the label by an attribute that we store. We came up with the desire to be able to place a line on that point of a predefined length and set the direction of the line to be in the angle of the rotation field. Has anyone ever attempted this?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 24 Jul 2015 19:59:32 GMT</pubDate>
    <dc:creator>KristineMuma</dc:creator>
    <dc:date>2015-07-24T19:59:32Z</dc:date>
    <item>
      <title>Can I place a line on a point using an attribute for the angle?</title>
      <link>https://community.esri.com/t5/python-questions/can-i-place-a-line-on-a-point-using-an-attribute/m-p/553828#M43258</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a set of points that I need to label in another software that has very limited labeling capabilities. We really need to be able to rotate the label by an attribute that we store. We came up with the desire to be able to place a line on that point of a predefined length and set the direction of the line to be in the angle of the rotation field. Has anyone ever attempted this?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Jul 2015 19:59:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/can-i-place-a-line-on-a-point-using-an-attribute/m-p/553828#M43258</guid>
      <dc:creator>KristineMuma</dc:creator>
      <dc:date>2015-07-24T19:59:32Z</dc:date>
    </item>
    <item>
      <title>Re: Can I place a line on a point using an attribute for the angle?</title>
      <link>https://community.esri.com/t5/python-questions/can-i-place-a-line-on-a-point-using-an-attribute/m-p/553829#M43259</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Have you considered Annotation &lt;/P&gt;&lt;P&gt;&lt;A href="http://resources.arcgis.com/en/help/main/10.2/index.html#//01m70000000w000000" title="http://resources.arcgis.com/en/help/main/10.2/index.html#//01m70000000w000000"&gt;http://resources.arcgis.com/en/help/main/10.2/index.html#//01m70000000w000000&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Jul 2015 20:10:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/can-i-place-a-line-on-a-point-using-an-attribute/m-p/553829#M43259</guid>
      <dc:creator>WesMiller</dc:creator>
      <dc:date>2015-07-24T20:10:18Z</dc:date>
    </item>
    <item>
      <title>Re: Can I place a line on a point using an attribute for the angle?</title>
      <link>https://community.esri.com/t5/python-questions/can-i-place-a-line-on-a-point-using-an-attribute/m-p/553830#M43260</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here's a script that should do what you're after:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&amp;gt;&amp;gt;&amp;gt; newLines = []
... points = "grid_label"
... angleField = "OID"
... lineLength = 300
... sr = arcpy.Describe(points).spatialReference
... with arcpy.da.SearchCursor(points,["SHAPE@",angleField],spatial_reference=sr) as cursor:
...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for row in cursor:
...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; x1 = row[0].centroid.X + (math.sin(math.radians(row[1]))*(lineLength/2))
...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; y1 = row[0].centroid.Y + (math.cos(math.radians(row[1]))*(lineLength/2))
...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; x2 = row[0].centroid.X - (math.sin(math.radians(row[1]))*(lineLength/2))
...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; y2 = row[0].centroid.Y - (math.cos(math.radians(row[1]))*(lineLength/2))
...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; newLine = arcpy.Polyline(arcpy.Array([arcpy.Point(x1,y1),arcpy.Point(x2,y2)]),sr)
...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; newLines.append(newLine)
... arcpy.CopyFeatures_management(newLines,r'in_memory\lines')&lt;/PRE&gt;&lt;P&gt;&lt;IMG __jive_id="118816" class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/118816_pastedImage_0.png" style="max-width: 1200px; max-height: 900px;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 23:56:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/can-i-place-a-line-on-a-point-using-an-attribute/m-p/553830#M43260</guid>
      <dc:creator>DarrenWiens2</dc:creator>
      <dc:date>2021-12-11T23:56:15Z</dc:date>
    </item>
    <item>
      <title>Re: Can I place a line on a point using an attribute for the angle?</title>
      <link>https://community.esri.com/t5/python-questions/can-i-place-a-line-on-a-point-using-an-attribute/m-p/553831#M43261</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Unfortunately Annotation is not an option. And using the annotation polygon isn't working because anything that is a single digit is labeling incorrectly or not at all in this third party software. We are extremely disappointed that this was not going to work! Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Jul 2015 13:50:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/can-i-place-a-line-on-a-point-using-an-attribute/m-p/553831#M43261</guid>
      <dc:creator>KristineMuma</dc:creator>
      <dc:date>2015-07-27T13:50:03Z</dc:date>
    </item>
    <item>
      <title>Re: Can I place a line on a point using an attribute for the angle?</title>
      <link>https://community.esri.com/t5/python-questions/can-i-place-a-line-on-a-point-using-an-attribute/m-p/553832#M43262</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Darren! I am so new to Python I knew I didn't have time to attempt to figure it out on my own.  I can't wait to try this....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;gt;&amp;gt;&amp;gt; Darren Wiens &amp;lt;geonet@esri.com&amp;gt; 7/24/2015 4:29 PM &amp;gt;&amp;gt;&amp;gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;GeoNet &lt;/P&gt;&lt;P&gt;( https://community.esri.com/?et=watches.email.thread) &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can I place a line on a point using an attribute for the angle? &lt;/P&gt;&lt;P&gt;reply from Darren Wiens&lt;/P&gt;&lt;P&gt;( https://community.esri.com/people/dkwiens?et=watches.email.thread)  in Developers - View the full discussion&lt;/P&gt;&lt;P&gt;( https://community.esri.com/message/538527?et=watches.email.thread#538527) &lt;/P&gt;&lt;P&gt;Here's a script that should do what you're after:&lt;/P&gt;&lt;P&gt;&amp;gt;&amp;gt;&amp;gt; newLines = []&lt;/P&gt;&lt;P&gt;... points = "grid_label"&lt;/P&gt;&lt;P&gt;... angleField = "OID"&lt;/P&gt;&lt;P&gt;... lineLength = 300&lt;/P&gt;&lt;P&gt;... sr = arcpy.Describe(points).spatialReference&lt;/P&gt;&lt;P&gt;... with arcpy.da.SearchCursor(points,["SHAPE@",angleField]) as cursor:&lt;/P&gt;&lt;P&gt;...    for row in cursor:&lt;/P&gt;&lt;P&gt;... 	   x1 = row[0].centroid.X + (math.sin(math.radians(row[1]))*(lineLength/2))&lt;/P&gt;&lt;P&gt;...  	  y1 = row[0].centroid.Y + (math.cos(math.radians(row[1]))*(lineLength/2))&lt;/P&gt;&lt;P&gt;...   	 x2 = row[0].centroid.X - (math.sin(math.radians(row[1]))*(lineLength/2))&lt;/P&gt;&lt;P&gt;...	    y2 = row[0].centroid.Y - (math.cos(math.radians(row[1]))*(lineLength/2))&lt;/P&gt;&lt;P&gt;... 	   newLine = arcpy.Polyline(arcpy.Array())&lt;/P&gt;&lt;P&gt;...  	  newLines.append(newLine)&lt;/P&gt;&lt;P&gt;... arcpy.CopyFeatures_management(newLines,r'in_memory\lines')&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;https://community.esri.com/servlet/JiveServlet/downloadImage/2-538527-118816/pastedImage_0.png &lt;/P&gt;&lt;P&gt;( https://community.esri.com/servlet/JiveServlet/showImage/2-538527-118816/pastedImage_0.png) &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reply to this message by replying to this email, or go to the message on GeoNet&lt;/P&gt;&lt;P&gt;( https://community.esri.com/message/538527?et=watches.email.thread#538527)  &lt;/P&gt;&lt;P&gt;Start a new discussion in Developers by email&lt;/P&gt;&lt;P&gt;( mailto:discussions-community-developers@mail.geonet.esri.com)  or at GeoNet&lt;/P&gt;&lt;P&gt;( https://community.esri.com/choose-container.jspa?contentType=1&amp;amp;containerType=14&amp;amp;container=2030&amp;amp;et=watches.email.thread)  &lt;/P&gt;&lt;P&gt;Following Can I place a line on a point using an attribute for the angle?&lt;/P&gt;&lt;P&gt;( https://community.esri.com/message/538527?et=watches.email.thread#538527)  in these streams: Inbox &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This email was sent by GeoNet because you are a registered user.&lt;/P&gt;&lt;P&gt;You may unsubscribe&lt;/P&gt;&lt;P&gt;( https://community.esri.com/unsubscribe.jspa?email=kmuma%40peterborough.ca&amp;amp;token=ddc1f5090c4eb13f98ad6c7c0516de919c7f5c29e1486eca3c3d526bae9eca83)  instantly from GeoNet, or adjust email frequency in your email preferences&lt;/P&gt;&lt;P&gt;( https://community.esri.com/user-preferences!input.jspa)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Jul 2015 14:17:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/can-i-place-a-line-on-a-point-using-an-attribute/m-p/553832#M43262</guid>
      <dc:creator>KristineMuma</dc:creator>
      <dc:date>2015-07-27T14:17:04Z</dc:date>
    </item>
  </channel>
</rss>

