<?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: da.InsertCursor to write geometry from csv file in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/da-insertcursor-to-write-geometry-from-csv-file/m-p/217868#M16767</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Josh. &amp;nbsp;I didn't understand how to make a list out of the rows in my csv. &amp;nbsp;Small gap in understanding on my end and I figured it out by experimenting. &amp;nbsp; I spent some extra time working through examples using the DA cursor and was able to get everything working. &amp;nbsp;Thanks.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 12 Jul 2017 00:27:58 GMT</pubDate>
    <dc:creator>TravisPeterson</dc:creator>
    <dc:date>2017-07-12T00:27:58Z</dc:date>
    <item>
      <title>da.InsertCursor to write geometry from csv file</title>
      <link>https://community.esri.com/t5/python-questions/da-insertcursor-to-write-geometry-from-csv-file/m-p/217861#M16760</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="text-decoration: line-through;"&gt;Are there any good examples showing how to create point geometry using arcpy.da.InsertCursor from a CSV File. &amp;nbsp;All the examples I find start with a list and not a file.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="text-decoration: line-through;"&gt;I attached the script I wrote using the old InsertCursor method. &amp;nbsp;I read da.InsertCursor is the better way to write geometry and I can't figure it out.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for the suggestions. &amp;nbsp;I figured it out. I posted response. &amp;nbsp;I just needed make a list out of the csv rows to pass to&amp;nbsp;my insert cursor. &amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Jul 2017 04:16:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/da-insertcursor-to-write-geometry-from-csv-file/m-p/217861#M16760</guid>
      <dc:creator>TravisPeterson</dc:creator>
      <dc:date>2017-07-11T04:16:18Z</dc:date>
    </item>
    <item>
      <title>Re: da.InsertCursor to write geometry from csv file</title>
      <link>https://community.esri.com/t5/python-questions/da-insertcursor-to-write-geometry-from-csv-file/m-p/217862#M16761</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm on an iPad, so not looking at the script, but wondering if there is a reason you are needing to use the cursor option? &amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You may want to look at&amp;nbsp;&lt;A class="link-titled" href="http://desktop.arcgis.com/en/arcmap/latest/tools/conversion-toolbox/excel-to-table.htm" title="http://desktop.arcgis.com/en/arcmap/latest/tools/conversion-toolbox/excel-to-table.htm"&gt;Excel To Table—Help | ArcGIS Desktop&lt;/A&gt;&amp;nbsp; or other import table options, then&lt;/P&gt;&lt;P&gt;and then&amp;nbsp;&lt;A class="link-titled" href="http://desktop.arcgis.com/en/arcmap/latest/tools/data-management-toolbox/make-xy-event-layer.htm" title="http://desktop.arcgis.com/en/arcmap/latest/tools/data-management-toolbox/make-xy-event-layer.htm"&gt;Make XY Event Layer—Help | ArcGIS Desktop&lt;/A&gt;&amp;nbsp;and then make sure to save the output. &amp;nbsp;There are more details on how to do that in the help files. &amp;nbsp; &amp;nbsp;These should be faster than trying to look at every record to create the geometry.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If if its a one time thing, you can also do something similar in ArcMap.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Jul 2017 05:04:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/da-insertcursor-to-write-geometry-from-csv-file/m-p/217862#M16761</guid>
      <dc:creator>RebeccaStrauch__GISP</dc:creator>
      <dc:date>2017-07-11T05:04:51Z</dc:date>
    </item>
    <item>
      <title>Re: da.InsertCursor to write geometry from csv file</title>
      <link>https://community.esri.com/t5/python-questions/da-insertcursor-to-write-geometry-from-csv-file/m-p/217863#M16762</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This is obviously classwork so giving you a direct solution would be unfair. Creating point geometry is pretty straightforward because it's typically just an X and a Y coordinate. Check out the documentation for more information.&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="http://desktop.arcgis.com/en/arcmap/latest/analyze/arcpy-classes/point.htm" title="http://desktop.arcgis.com/en/arcmap/latest/analyze/arcpy-classes/point.htm"&gt;Point—Help | ArcGIS Desktop&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Jul 2017 15:34:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/da-insertcursor-to-write-geometry-from-csv-file/m-p/217863#M16762</guid>
      <dc:creator>BlakeTerhune</dc:creator>
      <dc:date>2017-07-11T15:34:35Z</dc:date>
    </item>
    <item>
      <title>Re: da.InsertCursor to write geometry from csv file</title>
      <link>https://community.esri.com/t5/python-questions/da-insertcursor-to-write-geometry-from-csv-file/m-p/217864#M16763</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;To give the OP the benefit of the doubt, just because the attached script was created for a class final project, it doesn't mean this question is for a class project.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.esri.com/people/travisjpeterson"&gt;travisjpeterson&lt;/A&gt;‌, is this question for another class project?&amp;nbsp; The script you attached already does the job of loading CSV points into a feature class, all you need to do is modify lines 108 to 164 to use the DA cursor instead of the original cursor.&amp;nbsp; Since you already know how to open a CSV and loop over it, the real issue you are having appears to be understanding how the DA cursor works.&amp;nbsp; Do you have a specific issue that is confusing you?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Jul 2017 17:18:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/da-insertcursor-to-write-geometry-from-csv-file/m-p/217864#M16763</guid>
      <dc:creator>JoshuaBixby</dc:creator>
      <dc:date>2017-07-11T17:18:59Z</dc:date>
    </item>
    <item>
      <title>Re: da.InsertCursor to write geometry from csv file</title>
      <link>https://community.esri.com/t5/python-questions/da-insertcursor-to-write-geometry-from-csv-file/m-p/217865#M16764</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You're not helping yourself by providing a zip file. The script should by small enough to fit in the question page, so your participation will be hurt by a requirement to download, unzip, and open.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- V&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Jul 2017 17:46:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/da-insertcursor-to-write-geometry-from-csv-file/m-p/217865#M16764</guid>
      <dc:creator>VinceAngelo</dc:creator>
      <dc:date>2017-07-11T17:46:49Z</dc:date>
    </item>
    <item>
      <title>Re: da.InsertCursor to write geometry from csv file</title>
      <link>https://community.esri.com/t5/python-questions/da-insertcursor-to-write-geometry-from-csv-file/m-p/217866#M16765</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Travis,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You should be able to utilize the regular help to figure it out, especially if you have been all the way through Geog 485 Programming &amp;amp; Automation! &amp;nbsp;Is Jim Detwiler still teaching this class?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="http://desktop.arcgis.com/en/arcmap/latest/analyze/python/data-access-using-cursors.htm" title="http://desktop.arcgis.com/en/arcmap/latest/analyze/python/data-access-using-cursors.htm"&gt;Accessing data using cursors—Help | ArcGIS Desktop&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="http://desktop.arcgis.com/en/arcmap/latest/analyze/arcpy-data-access/insertcursor-class.htm" title="http://desktop.arcgis.com/en/arcmap/latest/analyze/arcpy-data-access/insertcursor-class.htm"&gt;InsertCursor—Help | ArcGIS Desktop&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.esri.com/thread/173442"&gt;Python arcpy.da.InsertCursor how to create a newRow()&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;~Alex&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Jul 2017 20:44:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/da-insertcursor-to-write-geometry-from-csv-file/m-p/217866#M16765</guid>
      <dc:creator>AlexanderBrown5</dc:creator>
      <dc:date>2017-07-11T20:44:15Z</dc:date>
    </item>
    <item>
      <title>Re: da.InsertCursor to write geometry from csv file</title>
      <link>https://community.esri.com/t5/python-questions/da-insertcursor-to-write-geometry-from-csv-file/m-p/217867#M16766</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey everyone. &amp;nbsp;Sorry to spark controversy. &amp;nbsp; &amp;nbsp;Just looking for a few examples not a complete script rewrite. &amp;nbsp;I figured out the answer myself this morning around 1:00AM. &amp;nbsp; I could have maybe asked a different way and been more clear.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;I ended up creating a tuple of values in a list, made a cursor with the matching fields in an existing feature class. I iterated through the list I made and inserted the row. &amp;nbsp;Ran into an issue with the SHAPE@XY, I needed to use SHAPE@X, &lt;A href="mailto:SHAPE@Y"&gt;SHAPE@Y&lt;/A&gt;. &amp;nbsp; I didn't understand that I could just make a list out of the row values in the csv. &amp;nbsp;Once I realized this I was able to make progress.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is basically what I came up with to get the job done. &amp;nbsp; Thanks to those that were constructive.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;rowValues = row[pointNum], row[elevation], row[featureType], &amp;nbsp;csvFileName, float(row[lat]), float(row[lon])&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;list.append(rowValues)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;cursor = arcpy.da.InsertCursor(fc,["PointNumber","Elevation","FeatureType", "FileName","SHAPE@Y", "SHAPE@X"])&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for row in list:&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;cursor.insertRow(row)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Jul 2017 23:45:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/da-insertcursor-to-write-geometry-from-csv-file/m-p/217867#M16766</guid>
      <dc:creator>TravisPeterson</dc:creator>
      <dc:date>2017-07-11T23:45:59Z</dc:date>
    </item>
    <item>
      <title>Re: da.InsertCursor to write geometry from csv file</title>
      <link>https://community.esri.com/t5/python-questions/da-insertcursor-to-write-geometry-from-csv-file/m-p/217868#M16767</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Josh. &amp;nbsp;I didn't understand how to make a list out of the rows in my csv. &amp;nbsp;Small gap in understanding on my end and I figured it out by experimenting. &amp;nbsp; I spent some extra time working through examples using the DA cursor and was able to get everything working. &amp;nbsp;Thanks.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Jul 2017 00:27:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/da-insertcursor-to-write-geometry-from-csv-file/m-p/217868#M16767</guid>
      <dc:creator>TravisPeterson</dc:creator>
      <dc:date>2017-07-12T00:27:58Z</dc:date>
    </item>
  </channel>
</rss>

