<?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 Creating Point Feature Class from Fields in Table in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/creating-point-feature-class-from-fields-in-table/m-p/660498#M51333</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi everyone one,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I wrote a script that searches Tweets and writes them to a table in a geodatabase. I got this to work finally, and now I would like to map out the tweets that have a location attached to them.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;As you can see in the following screenshot, I have a latitude and longitude field already:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;[ATTACH=CONFIG]29125[/ATTACH]&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;What would be the best approach to use these two fields and create a point feature class? I initially was thinking about&lt;/SPAN&gt;&lt;SPAN style="font-style:italic;"&gt; Add XY&lt;/SPAN&gt;&lt;SPAN&gt;, but I do not think that works with my data. I stumbled upon tokens (SHAPE@XY, for instance), and I was wondering if that might be what I need to implement.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Here is my current cursor in case that helps:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;cursor = arcpy.da.InsertCursor("E:/Redlands/MIP/Files/Twitter.gdb/TweetTable4", ("DateRun", "Username", "GeoEnabled", "Coordinates", "Latitude", "Longitude", "PostTime", "Tweet"))
&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any advice is appreciated. Thank you!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 15 Nov 2013 01:10:15 GMT</pubDate>
    <dc:creator>NumaGremling</dc:creator>
    <dc:date>2013-11-15T01:10:15Z</dc:date>
    <item>
      <title>Creating Point Feature Class from Fields in Table</title>
      <link>https://community.esri.com/t5/python-questions/creating-point-feature-class-from-fields-in-table/m-p/660498#M51333</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi everyone one,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I wrote a script that searches Tweets and writes them to a table in a geodatabase. I got this to work finally, and now I would like to map out the tweets that have a location attached to them.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;As you can see in the following screenshot, I have a latitude and longitude field already:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;[ATTACH=CONFIG]29125[/ATTACH]&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;What would be the best approach to use these two fields and create a point feature class? I initially was thinking about&lt;/SPAN&gt;&lt;SPAN style="font-style:italic;"&gt; Add XY&lt;/SPAN&gt;&lt;SPAN&gt;, but I do not think that works with my data. I stumbled upon tokens (SHAPE@XY, for instance), and I was wondering if that might be what I need to implement.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Here is my current cursor in case that helps:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;cursor = arcpy.da.InsertCursor("E:/Redlands/MIP/Files/Twitter.gdb/TweetTable4", ("DateRun", "Username", "GeoEnabled", "Coordinates", "Latitude", "Longitude", "PostTime", "Tweet"))
&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any advice is appreciated. Thank you!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 15 Nov 2013 01:10:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/creating-point-feature-class-from-fields-in-table/m-p/660498#M51333</guid>
      <dc:creator>NumaGremling</dc:creator>
      <dc:date>2013-11-15T01:10:15Z</dc:date>
    </item>
    <item>
      <title>Re: Creating Point Feature Class from Fields in Table</title>
      <link>https://community.esri.com/t5/python-questions/creating-point-feature-class-from-fields-in-table/m-p/660499#M51334</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Problem solved; figured it out after more browsing.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;In case anyone is interested, I first used &lt;/SPAN&gt;&lt;SPAN style="font-style:italic;"&gt;Make XY Event Layer&lt;/SPAN&gt;&lt;SPAN&gt;, which is a temporary layer, and then I saved it to a feature class, using &lt;/SPAN&gt;&lt;SPAN style="font-style:italic;"&gt;Feature To Point&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # Define input parameters
&amp;nbsp;&amp;nbsp;&amp;nbsp; inputTable = "E:/Redlands/MIP/Files/Twitter.gdb/TweetTable"
&amp;nbsp;&amp;nbsp;&amp;nbsp; xLong = "Longitude"
&amp;nbsp;&amp;nbsp;&amp;nbsp; yLat = "Latitude"
&amp;nbsp;&amp;nbsp;&amp;nbsp; outputLayer = "tweet_pts"

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # Create layer with above inputs
&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.MakeXYEventLayer_management(inputTable, xLong, yLat, outputLayer)

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # Save the event layer as a feature class
&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.FeatureToPoint_management(outputLayer, "E:/Redlands/MIP/Files/Twitter.gdb/TweetPoints")
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 03:56:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/creating-point-feature-class-from-fields-in-table/m-p/660499#M51334</guid>
      <dc:creator>NumaGremling</dc:creator>
      <dc:date>2021-12-12T03:56:44Z</dc:date>
    </item>
  </channel>
</rss>

