The ...spatial.to_featureclass() method no longer overwrites the existing feature class.
Sample code:
import arcpy
import pandas as pd
from arcgis.features import Feature
arcpy.env.overwriteOutput = True
df = pd.DataFrame.spatial.from_featureclass(<valid featureclass>)
#modify features in some fashion
df.spatial.to_featureclass(location=<path to existing feature class>, overwrite=True, sanitize_columns=False)
ArcGIS API for Python version 1.9.1
Solved! Go to Solution.
It works for me when I am using ArcGIS Pro 3.1.0. But the column aliases of the result output feature class are all the same as column names. The column aliases of the input feature class are not kept. That is the problem.
Are you using the ArcGIS Pro notebook environment? There are multiple other posts on here about this issue, seems to be a recent change.
I'd suggest using a separate Python env for this outside of Pro.
I use Spyder with a cloned env
Interesting. Recent updates to the arcgis package or arcpy? You could try rolling back to a prior version and see if it works. I'm at 2.0.0, and am able to export to feature class without issue. But then, I don't use arcpy, so I don't know if that's where people are experiencing the issue.
I just tested with the 1.9.1 in the stand along Jupyter notebook installed with ArcGIS Pro. Worked fine for me.
How is it failing? Does creating a new feature class still work if you give a slightly different name?
Maybe it is slow? I had a recent, still unanswered question, noting that the export is very slow. spatial.to_featureclass is very slow in writing to... - Esri Community
It works for me when I am using ArcGIS Pro 3.1.0. But the column aliases of the result output feature class are all the same as column names. The column aliases of the input feature class are not kept. That is the problem.