Spatial DataFrame to Feature Class no longer overwrites output

350
4
04-05-2022 08:15 AM
JohnHuillery1
Occasional Contributor

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

 

Tags (2)
0 Kudos
4 Replies
jcarlson
MVP Honored Contributor

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.

- Josh Carlson
Kendall County GIS
JohnHuillery1
Occasional Contributor

I use Spyder with a cloned env

jcarlson
MVP Honored Contributor

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.

- Josh Carlson
Kendall County GIS
0 Kudos
DavidAnderson_1701
Occasional Contributor

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

0 Kudos