<?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't export SpatialDataFrame to Shapefile  in ArcGIS API for Python Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-python-questions/can-t-export-spatialdataframe-to-shapefile/m-p/872350#M4757</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;STRONG&gt;Hi,&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;I'm trying to export a SpatialDataFrame which I've imported from ArcGis Online as such:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;gis = GIS("site_url", "username", password)&lt;/P&gt;&lt;P&gt;feature_layers=gis.content.get("some_id")&lt;BR /&gt;all_layers=&lt;SPAN&gt;feature_layers&lt;/SPAN&gt;.layers #get all layers&lt;/P&gt;&lt;P&gt;SDF= SpatialDataFrame.from_layer(&lt;SPAN&gt;all_layers&lt;/SPAN&gt;[0])&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;I need to use the SpatialDataFrame to do some spatial queries to modify the data, (text fields)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;When I try to export to a ShapeFile I get this error:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SDF.to_featureclass("output_folder","output_file.shp")&lt;BR /&gt;&amp;gt;&amp;gt;The following rows could not be written to the table: 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;If I try :&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;SPAN style="font-weight: 400;"&gt;SDF&lt;/SPAN&gt;&lt;SPAN style="font-weight: 400;"&gt;.to_featureclass("output_folder","output_file.shp", skip_invalid=False)&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Traceback (most recent call last):&lt;BR /&gt; File "C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\site-packages\arcgis\features\_data\geodataset\io\fileops.py", line 579, in to_featureclass&lt;BR /&gt; icur.insertRow(row)&lt;BR /&gt;RuntimeError: Cannot find field 'b'&lt;/P&gt;&lt;P&gt;During handling of the above exception, another exception occurred:&lt;/P&gt;&lt;P&gt;Traceback (most recent call last):&lt;BR /&gt; File "&amp;lt;pyshell#26&amp;gt;", line 1, in &amp;lt;module&amp;gt;&lt;BR /&gt;&lt;SPAN style="font-weight: 400;"&gt;&lt;STRONG&gt;SDF&lt;/STRONG&gt;&lt;/SPAN&gt;.to_featureclass("output_folder","output_file.shp",skip_invalid=False)&lt;BR /&gt; File "C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\site-packages\arcgis\features\_data\geodataset\geodataframe.py", line 1399, in to_featureclass&lt;BR /&gt; overwrite=overwrite, skip_invalid=skip_invalid)&lt;BR /&gt; File "C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\site-packages\arcgis\features\_data\geodataset\io\fileops.py", line 583, in to_featureclass&lt;BR /&gt; raise Exception("Invalid row detected at index: %s" % index)&lt;BR /&gt;Exception: Invalid row detected at index: 0&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;If i open the file created ( no records)&amp;nbsp; the second column is missing ? and an Id column has been inserted&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;any ideas ? I've made sure no fields are blank,null or None , I've tried renaming the columns&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Update: I Read in a Shapefile and tried to write it back to a new shapefile in a different folder with a different name and it gives the same error&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 11 Jan 2019 12:19:37 GMT</pubDate>
    <dc:creator>OisinSlevin</dc:creator>
    <dc:date>2019-01-11T12:19:37Z</dc:date>
    <item>
      <title>Can't export SpatialDataFrame to Shapefile</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/can-t-export-spatialdataframe-to-shapefile/m-p/872350#M4757</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;STRONG&gt;Hi,&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;I'm trying to export a SpatialDataFrame which I've imported from ArcGis Online as such:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;gis = GIS("site_url", "username", password)&lt;/P&gt;&lt;P&gt;feature_layers=gis.content.get("some_id")&lt;BR /&gt;all_layers=&lt;SPAN&gt;feature_layers&lt;/SPAN&gt;.layers #get all layers&lt;/P&gt;&lt;P&gt;SDF= SpatialDataFrame.from_layer(&lt;SPAN&gt;all_layers&lt;/SPAN&gt;[0])&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;I need to use the SpatialDataFrame to do some spatial queries to modify the data, (text fields)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;When I try to export to a ShapeFile I get this error:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SDF.to_featureclass("output_folder","output_file.shp")&lt;BR /&gt;&amp;gt;&amp;gt;The following rows could not be written to the table: 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;If I try :&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;SPAN style="font-weight: 400;"&gt;SDF&lt;/SPAN&gt;&lt;SPAN style="font-weight: 400;"&gt;.to_featureclass("output_folder","output_file.shp", skip_invalid=False)&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Traceback (most recent call last):&lt;BR /&gt; File "C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\site-packages\arcgis\features\_data\geodataset\io\fileops.py", line 579, in to_featureclass&lt;BR /&gt; icur.insertRow(row)&lt;BR /&gt;RuntimeError: Cannot find field 'b'&lt;/P&gt;&lt;P&gt;During handling of the above exception, another exception occurred:&lt;/P&gt;&lt;P&gt;Traceback (most recent call last):&lt;BR /&gt; File "&amp;lt;pyshell#26&amp;gt;", line 1, in &amp;lt;module&amp;gt;&lt;BR /&gt;&lt;SPAN style="font-weight: 400;"&gt;&lt;STRONG&gt;SDF&lt;/STRONG&gt;&lt;/SPAN&gt;.to_featureclass("output_folder","output_file.shp",skip_invalid=False)&lt;BR /&gt; File "C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\site-packages\arcgis\features\_data\geodataset\geodataframe.py", line 1399, in to_featureclass&lt;BR /&gt; overwrite=overwrite, skip_invalid=skip_invalid)&lt;BR /&gt; File "C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\site-packages\arcgis\features\_data\geodataset\io\fileops.py", line 583, in to_featureclass&lt;BR /&gt; raise Exception("Invalid row detected at index: %s" % index)&lt;BR /&gt;Exception: Invalid row detected at index: 0&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;If i open the file created ( no records)&amp;nbsp; the second column is missing ? and an Id column has been inserted&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;any ideas ? I've made sure no fields are blank,null or None , I've tried renaming the columns&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Update: I Read in a Shapefile and tried to write it back to a new shapefile in a different folder with a different name and it gives the same error&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Jan 2019 12:19:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/can-t-export-spatialdataframe-to-shapefile/m-p/872350#M4757</guid>
      <dc:creator>OisinSlevin</dc:creator>
      <dc:date>2019-01-11T12:19:37Z</dc:date>
    </item>
    <item>
      <title>Re: Can't export SpatialDataFrame to Shapefile</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/can-t-export-spatialdataframe-to-shapefile/m-p/872351#M4758</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What version of ArcGIS API for Python are you using?&amp;nbsp; Also, are you using the Spatial DataFrame, deprecated since version 1.5, or the Spatially-Enabled DataFrame (&lt;A class="link-titled" href="https://developers.arcgis.com/python/guide/introduction-to-the-spatially-enabled-dataframe/" title="https://developers.arcgis.com/python/guide/introduction-to-the-spatially-enabled-dataframe/"&gt;Introduction to the Spatially Enabled DataFrame | ArcGIS for Developers&lt;/A&gt;)?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Jan 2019 16:29:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/can-t-export-spatialdataframe-to-shapefile/m-p/872351#M4758</guid>
      <dc:creator>JoshuaBixby</dc:creator>
      <dc:date>2019-01-11T16:29:07Z</dc:date>
    </item>
    <item>
      <title>Re: Can't export SpatialDataFrame to Shapefile</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/can-t-export-spatialdataframe-to-shapefile/m-p/872352#M4759</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm using the python environment from ArcGis pro, but where the arcgis package version is 1.4.1 and it says my python packages are up to date.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Jan 2019 16:41:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/can-t-export-spatialdataframe-to-shapefile/m-p/872352#M4759</guid>
      <dc:creator>OisinSlevin</dc:creator>
      <dc:date>2019-01-11T16:41:30Z</dc:date>
    </item>
    <item>
      <title>Re: Can't export SpatialDataFrame to Shapefile</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/can-t-export-spatialdataframe-to-shapefile/m-p/872353#M4760</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Even if this is a bug, Esri is not going to patch 1.4.1.&amp;nbsp; I recommend upgrading to the latest version of the API (&lt;A class="link-titled" href="https://developers.arcgis.com/python/guide/install-and-set-up/#Upgrade-the-arcgis-package" title="https://developers.arcgis.com/python/guide/install-and-set-up/#Upgrade-the-arcgis-package"&gt;Install and set up | ArcGIS for Developers&lt;/A&gt; ) to see if the latest version is impacted.&amp;nbsp; Also, I would try using the new Spatially-Enabled DataFrame.&amp;nbsp; If the issue persists after those changes, then it will be worth raising to Esri Support.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Jan 2019 16:47:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/can-t-export-spatialdataframe-to-shapefile/m-p/872353#M4760</guid>
      <dc:creator>JoshuaBixby</dc:creator>
      <dc:date>2019-01-11T16:47:53Z</dc:date>
    </item>
    <item>
      <title>Re: Can't export SpatialDataFrame to Shapefile</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/can-t-export-spatialdataframe-to-shapefile/m-p/872354#M4761</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks, that has fixed my issue, I was trying initially to use&amp;nbsp;&lt;SPAN style="background-color: #ffffff;"&gt;Spatially-Enabled DataFrame as I've only recently installed arcgis pro I assumed the latest version of arcgis would be installed.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Jan 2019 17:17:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/can-t-export-spatialdataframe-to-shapefile/m-p/872354#M4761</guid>
      <dc:creator>OisinSlevin</dc:creator>
      <dc:date>2019-01-11T17:17:52Z</dc:date>
    </item>
    <item>
      <title>Re: Can't export SpatialDataFrame to Shapefile</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/can-t-export-spatialdataframe-to-shapefile/m-p/872355#M4762</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If your issue has been resolved, either mark someone's response as the correct answer or the question as assumed answered to close it out.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Jan 2019 18:10:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/can-t-export-spatialdataframe-to-shapefile/m-p/872355#M4762</guid>
      <dc:creator>JoshuaBixby</dc:creator>
      <dc:date>2019-01-11T18:10:56Z</dc:date>
    </item>
  </channel>
</rss>

