<?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: Export ArcGIS spatially enabled dataframe to feature class in ArcGIS API for Python Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-python-questions/export-arcgis-spatially-enabled-dataframe-to/m-p/1160978#M7276</link>
    <description>&lt;P&gt;Yeah I just took a look at that post. I do have other environments but ultimately, I'm going to turn this script into a geoprocessing tool for non-programmer ArcGIS Pro users to use to pull in layers from our Socrata data portal. Also, I'm not sure that you can write to file geodatabases without arcpy, correct?&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 04 Apr 2022 22:02:01 GMT</pubDate>
    <dc:creator>jcroff</dc:creator>
    <dc:date>2022-04-04T22:02:01Z</dc:date>
    <item>
      <title>Export ArcGIS spatially enabled dataframe to feature class</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/export-arcgis-spatially-enabled-dataframe-to/m-p/1160954#M7274</link>
      <description>&lt;P&gt;I'm working to develop a tool that converts JSON data pulled from an API into a feature class to be stored in an ESRI file geodatabase. I'm currently testing the functionality in a Jupyter notebook within an ArcGIS Pro project but my goal is to eventually convert my script into a geoprocessing tool that can be used by non-developer users. However, I've gotten stuck in the prototype phase and cannot figure out if I am running into a bug or if there is an issue with my code.&lt;/P&gt;&lt;P&gt;Here is my code:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;import requests
import arcpy
from arcgis.features import GeoAccessor, GeoSeriesAccessor
import pandas as pd

# pull public geojson data from socrata

r = requests.get('https://data.bayareametro.gov/resource/ufzj-38uk.json')
j = r.json()
df = pd.DataFrame.from_dict(j)

# Convert to Spatially Enabled Pandas Dataframe

sedf = pd.DataFrame.spatial.from_df(df, geometry_column='shape')

# Export Spatially Enabled Pandas Dataframe to FGDB Feature Class

sedf.spatial.to_featureclass(location='equity_priority_areas_2020')&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is the error message I received:&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;---------------------------------------------------------------------------&lt;BR /&gt;ValueError Traceback (most recent call last)&lt;BR /&gt;In [22]:&lt;BR /&gt;Line 5: sanitize_columns=True)&lt;/P&gt;&lt;P&gt;File C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\site-packages\arcgis\features\geo\_accessor.py, in to_featureclass:&lt;BR /&gt;Line 2388: has_m=has_m,&lt;/P&gt;&lt;P&gt;File C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\site-packages\arcgis\features\geo\_io\fileops.py, in to_featureclass:&lt;BR /&gt;Line 853: df.columns = original_columns&lt;/P&gt;&lt;P&gt;File C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\site-packages\pandas\core\generic.py, in __setattr__:&lt;BR /&gt;Line 5478: return object.__setattr__(self, name, value)&lt;/P&gt;&lt;P&gt;File pandas\_libs\properties.pyx, in pandas._libs.properties.AxisProperty.__set__:&lt;BR /&gt;Line 66:&lt;/P&gt;&lt;P&gt;File C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\site-packages\pandas\core\generic.py, in _set_axis:&lt;BR /&gt;Line 670: self._mgr.set_axis(axis, labels)&lt;/P&gt;&lt;P&gt;File C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\site-packages\pandas\core\internals\managers.py, in set_axis:&lt;BR /&gt;Line 221: f"Length mismatch: Expected axis has {old_len} elements, new "&lt;/P&gt;&lt;P&gt;ValueError: Length mismatch: Expected axis has 42 elements, new values have 41 elements&lt;BR /&gt;---------------------------------------------------------------------------&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Here is what I tried to resolve the issue:&lt;/P&gt;&lt;P&gt;I reviewed the GeoAccessor class method [to_featureclass](&lt;A href="https://developers.arcgis.com/python/api-reference/arcgis.features.toc.html#arcgis.features.GeoAccessor.to_featureclass" target="_blank"&gt;https://developers.arcgis.com/python/api-reference/arcgis.features.toc.html#arcgis.features.GeoAccessor.to_featureclass&lt;/A&gt;) API reference and tried to set the path to the File Geodatabase explicitly as well as provide explicit values for the `has_z`, `haz_m`, and `sanitize_columns` parameters as shown below and got the same error message.&lt;/P&gt;&lt;LI-CODE lang="python"&gt;sedf.spatial.to_featureclass(location='Z:\Documents\ArcGIS\Projects\Socrata_to_ArcGIS\Socrata_to_ArcGIS.gdb\equity_priority_areas_2020',
overwrite=True,
has_z=False,
has_m=False,
sanitize_columns=True)&lt;/LI-CODE&gt;&lt;P&gt;I seem to always run into issues when trying to perform seemingly basic things with these spatially enabled dataframes.&lt;/P&gt;</description>
      <pubDate>Mon, 04 Apr 2022 20:16:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/export-arcgis-spatially-enabled-dataframe-to/m-p/1160954#M7274</guid>
      <dc:creator>jcroff</dc:creator>
      <dc:date>2022-04-04T20:16:54Z</dc:date>
    </item>
    <item>
      <title>Re: Export ArcGIS spatially enabled dataframe to feature class</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/export-arcgis-spatially-enabled-dataframe-to/m-p/1160960#M7275</link>
      <description>&lt;P&gt;Someone else recently posted about this same (or at least a very similar) issue:&amp;nbsp;&lt;A href="https://community.esri.com/t5/arcgis-api-for-python-questions/my-agol-notebooks-are-not-working/m-p/1159406#M7265" target="_blank"&gt;https://community.esri.com/t5/arcgis-api-for-python-questions/my-agol-notebooks-are-not-working/m-p/1159406#M7265&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Do you have any other Python envs where you could try the same code? If it doesn't actually&amp;nbsp;&lt;EM&gt;need&amp;nbsp;&lt;/EM&gt;arcpy, there's no reason you can't run this sort of thing elsewhere.&lt;/P&gt;</description>
      <pubDate>Mon, 04 Apr 2022 20:38:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/export-arcgis-spatially-enabled-dataframe-to/m-p/1160960#M7275</guid>
      <dc:creator>jcarlson</dc:creator>
      <dc:date>2022-04-04T20:38:12Z</dc:date>
    </item>
    <item>
      <title>Re: Export ArcGIS spatially enabled dataframe to feature class</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/export-arcgis-spatially-enabled-dataframe-to/m-p/1160978#M7276</link>
      <description>&lt;P&gt;Yeah I just took a look at that post. I do have other environments but ultimately, I'm going to turn this script into a geoprocessing tool for non-programmer ArcGIS Pro users to use to pull in layers from our Socrata data portal. Also, I'm not sure that you can write to file geodatabases without arcpy, correct?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 04 Apr 2022 22:02:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/export-arcgis-spatially-enabled-dataframe-to/m-p/1160978#M7276</guid>
      <dc:creator>jcroff</dc:creator>
      <dc:date>2022-04-04T22:02:01Z</dc:date>
    </item>
    <item>
      <title>Re: Export ArcGIS spatially enabled dataframe to feature class</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/export-arcgis-spatially-enabled-dataframe-to/m-p/1160981#M7277</link>
      <description>&lt;P&gt;By default, no. If you want to write to a file geodatabase from outside of arcpy, you've got to download the File Geodatabase API and get that set up on your system.&lt;/P&gt;&lt;P&gt;&lt;A href="https://github.com/Esri/file-geodatabase-api/" target="_blank"&gt;https://github.com/Esri/file-geodatabase-api/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;There's a separate space for the FGDB API here on the Community, too! Not incredibly active, but you can see how other folks are using this.&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.esri.com/t5/file-geodatabase-api/ct-p/file-geodatabase-api" target="_blank"&gt;https://community.esri.com/t5/file-geodatabase-api/ct-p/file-geodatabase-api&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 04 Apr 2022 22:20:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/export-arcgis-spatially-enabled-dataframe-to/m-p/1160981#M7277</guid>
      <dc:creator>jcarlson</dc:creator>
      <dc:date>2022-04-04T22:20:18Z</dc:date>
    </item>
    <item>
      <title>Re: Export ArcGIS spatially enabled dataframe to feature class</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/export-arcgis-spatially-enabled-dataframe-to/m-p/1161210#M7283</link>
      <description>&lt;P&gt;Hi all, Can someone please clear me the below post mentioned:&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.esri.com/t5/file-geodatabase-api/ct-p/file-geodatabase-api" target="_blank" rel="noopener"&gt;https://community.esri.com/t5/file-geodatabase-api/ct-p/file-geodatabase-api-&lt;/A&gt;&lt;A href="https://apnpgc.org/project-qt-mod/" target="_blank" rel="noopener"&gt;apnpgc&lt;/A&gt;&lt;/P&gt;&lt;P&gt;I am little bit confused about the API.&lt;/P&gt;</description>
      <pubDate>Tue, 05 Apr 2022 16:00:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/export-arcgis-spatially-enabled-dataframe-to/m-p/1161210#M7283</guid>
      <dc:creator>apnpgc</dc:creator>
      <dc:date>2022-04-05T16:00:56Z</dc:date>
    </item>
  </channel>
</rss>

