<?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: Panda sdf.spatial.to_featureclass fails to write Featureclass but writes shapefile in ArcGIS API for Python Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-python-questions/panda-sdf-spatial-to-featureclass-fails-to-write/m-p/872934#M4787</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I can only find references to&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="https://developers.arcgis.com/python/api-reference/arcgis.features.toc.html?highlight=spatial%20to_featureclass#arcgis.features.SpatialDataFrame.to_featureclass" title="https://developers.arcgis.com/python/api-reference/arcgis.features.toc.html?highlight=spatial%20to_featureclass#arcgis.features.SpatialDataFrame.to_featureclass"&gt;arcgis.features module — arcgis 1.8.0 documentation&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;to convert&amp;nbsp;&lt;SPAN style="color: #404040; background-color: #fcfcfc;"&gt;converts a&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class="" style="color: #404040; background: #f1c40f; font-weight: bold; padding: 0px 6px;"&gt;Spatial&lt;/SPAN&gt;&lt;SPAN style="color: #404040; background-color: #fcfcfc;"&gt;DataFrame to a feature class&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 12 Jun 2020 00:21:27 GMT</pubDate>
    <dc:creator>DanPatterson</dc:creator>
    <dc:date>2020-06-12T00:21:27Z</dc:date>
    <item>
      <title>Panda sdf.spatial.to_featureclass fails to write Featureclass but writes shapefile</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/panda-sdf-spatial-to-featureclass-fails-to-write/m-p/872931#M4784</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Below is the abbreviated copy of my code. I take an Excel file, read into a panda dataframe, convert that to a spatial dataframe and write it out as a point featureclass. If I write a shapefile it works but when I write to a File GDB it writes nothing and doesn't even show an error.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My Code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;import pandas as pd&lt;BR /&gt;from arcgis.features import GeoAccessor, GeoSeriesAccessor&lt;/P&gt;&lt;P&gt;df = pd.read_excel (filename)&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;# convert Pandas dataframe to Spatial Data Frame&lt;BR /&gt;sdf= pd.DataFrame.spatial.from_xy(df=df,&lt;BR /&gt; x_column='Structure_Lng',&lt;BR /&gt; y_column='Structure Lat',&lt;BR /&gt; sr=4326)&lt;/P&gt;&lt;P&gt;# show first 5 records in SDF&lt;BR /&gt;print(sdf.head()) # looks good&lt;/P&gt;&lt;P&gt;#Convert SDF to Featureclass. ### This fails&lt;BR /&gt;sdf.spatial.to_featureclass(location="C:/temp/test.fdb/myPts", overwrite=True);&lt;/P&gt;&lt;P&gt;# this works&lt;BR /&gt;sdf.spatial.to_featureclass(location="C:/temp/myPts.shp", overwrite=True)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Jun 2020 21:56:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/panda-sdf-spatial-to-featureclass-fails-to-write/m-p/872931#M4784</guid>
      <dc:creator>BillChappell</dc:creator>
      <dc:date>2020-06-11T21:56:01Z</dc:date>
    </item>
    <item>
      <title>Re: Panda sdf.spatial.to_featureclass fails to write Featureclass but writes shapefile</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/panda-sdf-spatial-to-featureclass-fails-to-write/m-p/872932#M4785</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;"C:/temp/test.fdb&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;do you mean&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;&lt;SPAN&gt;"C:/temp/test.gdb&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Jun 2020 00:05:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/panda-sdf-spatial-to-featureclass-fails-to-write/m-p/872932#M4785</guid>
      <dc:creator>DanPatterson</dc:creator>
      <dc:date>2020-06-12T00:05:59Z</dc:date>
    </item>
    <item>
      <title>Re: Panda sdf.spatial.to_featureclass fails to write Featureclass but writes shapefile</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/panda-sdf-spatial-to-featureclass-fails-to-write/m-p/872933#M4786</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It was gdb on my code but I must have typed it wrong when posting. Either way, no featureclass.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Jun 2020 00:11:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/panda-sdf-spatial-to-featureclass-fails-to-write/m-p/872933#M4786</guid>
      <dc:creator>BillChappell</dc:creator>
      <dc:date>2020-06-12T00:11:05Z</dc:date>
    </item>
    <item>
      <title>Re: Panda sdf.spatial.to_featureclass fails to write Featureclass but writes shapefile</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/panda-sdf-spatial-to-featureclass-fails-to-write/m-p/872934#M4787</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I can only find references to&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="https://developers.arcgis.com/python/api-reference/arcgis.features.toc.html?highlight=spatial%20to_featureclass#arcgis.features.SpatialDataFrame.to_featureclass" title="https://developers.arcgis.com/python/api-reference/arcgis.features.toc.html?highlight=spatial%20to_featureclass#arcgis.features.SpatialDataFrame.to_featureclass"&gt;arcgis.features module — arcgis 1.8.0 documentation&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;to convert&amp;nbsp;&lt;SPAN style="color: #404040; background-color: #fcfcfc;"&gt;converts a&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class="" style="color: #404040; background: #f1c40f; font-weight: bold; padding: 0px 6px;"&gt;Spatial&lt;/SPAN&gt;&lt;SPAN style="color: #404040; background-color: #fcfcfc;"&gt;DataFrame to a feature class&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Jun 2020 00:21:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/panda-sdf-spatial-to-featureclass-fails-to-write/m-p/872934#M4787</guid>
      <dc:creator>DanPatterson</dc:creator>
      <dc:date>2020-06-12T00:21:27Z</dc:date>
    </item>
    <item>
      <title>Re: Panda sdf.spatial.to_featureclass fails to write Featureclass but writes shapefile</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/panda-sdf-spatial-to-featureclass-fails-to-write/m-p/872935#M4788</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm converting a panda DF to a spatial DF.:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;# convert Pandas dataframe to Spatial Data Frame&lt;BR /&gt;sdf= pd.DataFrame.spatial.from_xy(df=df,&lt;BR /&gt; x_column='Structure_Lng',&lt;BR /&gt; y_column='Structure Lat',&lt;BR /&gt; sr=4326)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I got that from Esri Training, so it must be right....&lt;BR /&gt;&lt;A href="https://www.esri.com/training/catalog/5ea8a5c359bcad254d2eb63b/arcgis-api-for-python%3A-getting-to-know-pandas-and-the-spatial-enabled-dataframe/"&gt;https://www.esri.com/training/catalog/5ea8a5c359bcad254d2eb63b/arcgis-api-for-python%3A-getting-to-know-pandas-and-the-spatial-enabled-dataframe/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now to export it as a shapefile. :&lt;/P&gt;&lt;P&gt;# &lt;SPAN style="color: #ff0000;"&gt;this works so my spatial dataframe should be ok?&lt;/SPAN&gt;&lt;BR /&gt;sdf.spatial.to_featureclass(location="C:/temp/myPts.shp", overwrite=True)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Trying a FC in a File gdb&amp;nbsp;&lt;/P&gt;&lt;P&gt;#Convert SDF to Featureclass. ### &lt;SPAN style="color: #ff0000;"&gt;This fails&lt;/SPAN&gt;&lt;BR /&gt;sdf.spatial.to_featureclass(location="C:/temp/test.fdb/myPts", overwrite=True);&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Jun 2020 00:47:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/panda-sdf-spatial-to-featureclass-fails-to-write/m-p/872935#M4788</guid>
      <dc:creator>BillChappell</dc:creator>
      <dc:date>2020-06-12T00:47:46Z</dc:date>
    </item>
    <item>
      <title>Re: Panda sdf.spatial.to_featureclass fails to write Featureclass but writes shapefile</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/panda-sdf-spatial-to-featureclass-fails-to-write/m-p/872936#M4789</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&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;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I don't see where you imported "arcpy"&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;&lt;SPAN style="color: #6e6e6e; background-color: #ffffff;"&gt;The ArcGIS API for Python installs on all&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;CODE style="color: #595959; background-color: #f8f8f8; border: 1px solid #efefef; font-size: 0.875em;"&gt;macOS&lt;/CODE&gt;&lt;SPAN style="color: #6e6e6e; background-color: #ffffff;"&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;and&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;CODE style="color: #595959; background-color: #f8f8f8; border: 1px solid #efefef; font-size: 0.875em;"&gt;Linux&lt;/CODE&gt;&lt;SPAN style="color: #6e6e6e; background-color: #ffffff;"&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;machines, as well as those&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;CODE style="color: #595959; background-color: #f8f8f8; border: 1px solid #efefef; font-size: 0.875em;"&gt;Windows&lt;/CODE&gt;&lt;SPAN style="color: #6e6e6e; background-color: #ffffff;"&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;machines not using Python interpreters that have access to&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;CODE style="color: #595959; background-color: #f8f8f8; border: 1px solid #efefef; font-size: 0.875em;"&gt;ArcPy&lt;/CODE&gt;&lt;SPAN style="color: #6e6e6e; background-color: #ffffff;"&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;will only be able to write out to shapefile format with the&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;CODE style="color: #595959; background-color: #f8f8f8; border: 1px solid #efefef; font-size: 0.875em;"&gt;to_featureclass&lt;/CODE&gt;&lt;SPAN style="color: #6e6e6e; background-color: #ffffff;"&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;method. Writing to file geodatabases requires the&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;CODE style="color: #595959; background-color: #f8f8f8; border: 1px solid #efefef; font-size: 0.875em;"&gt;ArcPy&lt;/CODE&gt;&lt;SPAN style="color: #6e6e6e; background-color: #ffffff;"&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;site-package.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;The arcgis module performs checks to see whether arcpy is imported, If it is, then you can write to featureclasses, If it isn't then it uses the "shapely" module which can only write shapefiles.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can examine all the revealed code in your installation path&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;C:\&lt;STRONG&gt;Path_to_ArcGISPro&lt;/STRONG&gt;\bin\Python\envs\arcgispro-py3\Lib\site-packages\arcgis&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Your particular method is described in&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;C:&lt;SPAN&gt;\&lt;/SPAN&gt;&lt;STRONG&gt;Path_to_ArcGISPro&lt;/STRONG&gt;\bin\Python\envs\arcgispro-py3\Lib\site-packages\arcgis\features\_data\geodataset\geodataframe.py&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The SpatialDataFrame class has the&amp;nbsp;to_featureclass method which imports&amp;nbsp;to_featureclass from the _io module&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;C:\...\bin\Python\envs\arcgispro-py3\Lib\site-packages\arcgis\features\_data\geodataset\io\fileops.py&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The&amp;nbsp;&amp;nbsp;to_featureclass method, checks to see if arcpy is installed (around line 400), if so, it can create a featureclass in a gdb.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So in short, just see if adding&lt;/P&gt;&lt;P&gt;import arcpy&lt;/P&gt;&lt;P&gt;to your script allows you to save to a featureclass&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Jun 2020 01:35:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/panda-sdf-spatial-to-featureclass-fails-to-write/m-p/872936#M4789</guid>
      <dc:creator>DanPatterson</dc:creator>
      <dc:date>2020-06-12T01:35:54Z</dc:date>
    </item>
    <item>
      <title>Re: Panda sdf.spatial.to_featureclass fails to write Featureclass but writes shapefile</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/panda-sdf-spatial-to-featureclass-fails-to-write/m-p/872937#M4790</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Got it. While I was running my script thru Python 3.6.8 IDLE, I had never logged into Pro on this laptop. Once I logged in, it threw an error and I found some Lat/Lngs were actually null throwing a bad geometry error. By making a shapefile these were just ignored, to a featureclass these were an issue. So .fillna(0) fixed that.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My working script is attached as a text file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for the help.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Jun 2020 14:41:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/panda-sdf-spatial-to-featureclass-fails-to-write/m-p/872937#M4790</guid>
      <dc:creator>BillChappell</dc:creator>
      <dc:date>2020-06-12T14:41:52Z</dc:date>
    </item>
    <item>
      <title>Re: Panda sdf.spatial.to_featureclass fails to write Featureclass but writes shapefile</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/panda-sdf-spatial-to-featureclass-fails-to-write/m-p/1090374#M6514</link>
      <description>&lt;P&gt;Thanks ..!&lt;/P&gt;&lt;P&gt;How to transform data from SR 4326 to 27700(BNG)?&lt;/P&gt;</description>
      <pubDate>Thu, 19 Aug 2021 14:35:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/panda-sdf-spatial-to-featureclass-fails-to-write/m-p/1090374#M6514</guid>
      <dc:creator>SanjaykumarRajbhar</dc:creator>
      <dc:date>2021-08-19T14:35:11Z</dc:date>
    </item>
  </channel>
</rss>

