<?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: Adding XY Coordinates from a table (.csv) file into ArcMap using Python in ArcGIS Online Questions</title>
    <link>https://community.esri.com/t5/arcgis-online-questions/adding-xy-coordinates-from-a-table-csv-file-into/m-p/500137#M25199</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Whoops, made a mistake with latitude and longitude, will let you know if that was the mistake I made.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 02 May 2020 17:55:31 GMT</pubDate>
    <dc:creator>ShalinR</dc:creator>
    <dc:date>2020-05-02T17:55:31Z</dc:date>
    <item>
      <title>Adding XY Coordinates from a table (.csv) file into ArcMap using Python</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/adding-xy-coordinates-from-a-table-csv-file-into/m-p/500131#M25193</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I do not where I went wrong here. Please help me.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;import arcpy&lt;BR /&gt;import fileinput&lt;BR /&gt;import string&lt;BR /&gt;import os&lt;BR /&gt;from arcpy import env&lt;BR /&gt;env.workspace = "P:\GEOG - Programming in GIS\Final project\Data"&lt;BR /&gt;env.overwrightOutput = True&lt;BR /&gt;outpath = "P:\GEOG - Programming in GIS\Final project\Data"&lt;BR /&gt;newfc= "Results/NewPtssss.shp"&lt;BR /&gt;arcpy.CreateFeatureclass_management(outpath, newfc, "Point")&lt;BR /&gt;infile = "P:\GEOG - Programming in GIS\Final project\Data\coordinates.txt"&lt;BR /&gt;cursor = arcpy.da.InsertCursor(newfc, ["SHAPE@"])&lt;BR /&gt;array = arcpy.Array()&lt;BR /&gt;for point in fileinput.input(infile):&lt;BR /&gt; if ":" in point:&lt;BR /&gt; x, y = string.strip().split(":")&lt;BR /&gt; array.add(arcpy.Point(x, y))&lt;BR /&gt;cursor.insertRow([arcpy.Point(array)])&lt;BR /&gt;fileinput.close()&lt;BR /&gt;del cursor&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I get the following error:&lt;BR /&gt;Traceback (most recent call last):&lt;BR /&gt; File "P:/GEOG - Programming in GIS/XYToPoint_Practice.py", line 18, in &amp;lt;module&amp;gt;&lt;BR /&gt; cursor.insertRow([arcpy.Point(array)])&lt;BR /&gt; File "P:\ArcMap\Desktop10.7\ArcPy\arcpy\arcobjects\mixins.py", line 1122, in __init__&lt;BR /&gt; setattr(self, attr, value)&lt;BR /&gt; File "P:\ArcMap\Desktop10.7\ArcPy\arcpy\arcobjects\_base.py", line 89, in _set&lt;BR /&gt; return setattr(self._arc_object, attr_name, cval(val))&lt;BR /&gt;RuntimeError: Point: Input value is not numeric&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 02 May 2020 03:20:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/adding-xy-coordinates-from-a-table-csv-file-into/m-p/500131#M25193</guid>
      <dc:creator>ShalinR</dc:creator>
      <dc:date>2020-05-02T03:20:35Z</dc:date>
    </item>
    <item>
      <title>Re: Adding XY Coordinates from a table (.csv) file into ArcMap using Python</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/adding-xy-coordinates-from-a-table-csv-file-into/m-p/500132#M25194</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;A href="https://community.esri.com/blogs/dan_patterson/2016/08/14/script-formatting"&gt;/blogs/dan_patterson/2016/08/14/script-formatting&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Format your code so indentation can be checked and people can answer with respect to line numbers.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 02 May 2020 04:48:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/adding-xy-coordinates-from-a-table-csv-file-into/m-p/500132#M25194</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2020-05-02T04:48:52Z</dc:date>
    </item>
    <item>
      <title>Re: Adding XY Coordinates from a table (.csv) file into ArcMap using Python</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/adding-xy-coordinates-from-a-table-csv-file-into/m-p/500133#M25195</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;pnt &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"1.1:2.2"&lt;/SPAN&gt;

coords &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; pnt&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;strip&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;split&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;":"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

x&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; y &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;float&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;val&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;for&lt;/SPAN&gt; val &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; coords&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;‍‍‍‍‍

x&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; y
&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;1.1&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;2.2&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;For your immediate problem, you weren't splitting the point (pnt) into its constituent parts properly,&lt;/P&gt;&lt;P&gt;python's "split" returns a list of string values,&lt;/P&gt;&lt;P&gt;They need to be converted to 'float' values before you pass them on to arcpy's Point object.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 21:57:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/adding-xy-coordinates-from-a-table-csv-file-into/m-p/500133#M25195</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2021-12-11T21:57:51Z</dc:date>
    </item>
    <item>
      <title>Re: Adding XY Coordinates from a table (.csv) file into ArcMap using Python</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/adding-xy-coordinates-from-a-table-csv-file-into/m-p/500134#M25196</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sorry about the formatting. Never previously posted a question of this nature. Thanks for the reply. So am I replacing the code example you provided for line 14?&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 02 May 2020 14:30:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/adding-xy-coordinates-from-a-table-csv-file-into/m-p/500134#M25196</guid>
      <dc:creator>ShalinR</dc:creator>
      <dc:date>2020-05-02T14:30:48Z</dc:date>
    </item>
    <item>
      <title>Re: Adding XY Coordinates from a table (.csv) file into ArcMap using Python</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/adding-xy-coordinates-from-a-table-csv-file-into/m-p/500135#M25197</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;One quick thing I'm not sure if you already noticed (it's not directly related to your error message), but you have a typo in the beginning....should be&amp;nbsp;&lt;SPAN style="color: #4d4d4d; background-color: #fafafa;"&gt;&lt;STRONG&gt;env.overwriteOutput&lt;/STRONG&gt;, not env.overwrightOutput&amp;nbsp; &lt;IMG src="https://community.esri.com/legacyfs/online/emoticons/happy.png" /&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 02 May 2020 16:09:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/adding-xy-coordinates-from-a-table-csv-file-into/m-p/500135#M25197</guid>
      <dc:creator>Katie_Clark</dc:creator>
      <dc:date>2020-05-02T16:09:05Z</dc:date>
    </item>
    <item>
      <title>Re: Adding XY Coordinates from a table (.csv) file into ArcMap using Python</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/adding-xy-coordinates-from-a-table-csv-file-into/m-p/500136#M25198</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for catching my mistake. So I ended up using another script, which I'm attaching to the reply, and I got no errors. But the problem now is that the point shapefile prints points nowhere near the shapefile of the state that I am trying to plot them onto.&amp;nbsp;&lt;IMG alt="" class="jive-emoji image-1 jive-image j-img-original" src="https://community.esri.com/legacyfs/online/490732_Point.JPG" /&gt;&lt;IMG alt="" class="jive-emoji jive-image image-2 j-img-original" src="https://community.esri.com/legacyfs/online/490742_ProblemPoint.JPG" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 02 May 2020 17:50:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/adding-xy-coordinates-from-a-table-csv-file-into/m-p/500136#M25198</guid>
      <dc:creator>ShalinR</dc:creator>
      <dc:date>2020-05-02T17:50:25Z</dc:date>
    </item>
    <item>
      <title>Re: Adding XY Coordinates from a table (.csv) file into ArcMap using Python</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/adding-xy-coordinates-from-a-table-csv-file-into/m-p/500137#M25199</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Whoops, made a mistake with latitude and longitude, will let you know if that was the mistake I made.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 02 May 2020 17:55:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/adding-xy-coordinates-from-a-table-csv-file-into/m-p/500137#M25199</guid>
      <dc:creator>ShalinR</dc:creator>
      <dc:date>2020-05-02T17:55:31Z</dc:date>
    </item>
    <item>
      <title>Re: Adding XY Coordinates from a table (.csv) file into ArcMap using Python</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/adding-xy-coordinates-from-a-table-csv-file-into/m-p/500138#M25200</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That was it. All the points are where I needed them to be. Thanks for all your help&amp;nbsp;&lt;A href="https://community.esri.com/migrated-users/287505"&gt;Katherine Clark&lt;/A&gt;&amp;nbsp;@Dan Patterson&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 02 May 2020 18:05:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/adding-xy-coordinates-from-a-table-csv-file-into/m-p/500138#M25200</guid>
      <dc:creator>ShalinR</dc:creator>
      <dc:date>2020-05-02T18:05:23Z</dc:date>
    </item>
    <item>
      <title>Re: Adding XY Coordinates from a table (.csv) file into ArcMap using Python</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/adding-xy-coordinates-from-a-table-csv-file-into/m-p/500139#M25201</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Please mark a reply as Correct or mark the thread as assumed answered to close it out.&amp;nbsp; Also, make sure to mark Helpfuls for comments that were, well, helpful.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 03 May 2020 13:34:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/adding-xy-coordinates-from-a-table-csv-file-into/m-p/500139#M25201</guid>
      <dc:creator>JoshuaBixby</dc:creator>
      <dc:date>2020-05-03T13:34:12Z</dc:date>
    </item>
  </channel>
</rss>

