Spatially Enabled Dataframe to_featureclass results in NULL attributes when exporting to SDE table

519
1
08-02-2021 06:00 AM
markjones6
New Contributor II

Hi,

 

When trying to export a spatially enabled dataframe to a feature class in SDE or as a shp, the featureclass retains it's geometry, but all attributes result in NULL values in the exported feature class.  If i perform an export to AGO using to_featurelayer, then the attributes are exported as expected.

The command used is:

test_sdf = pd.Dataframe.spatial.to_featureclass(location=**sde connection here**)

 

Any thoughts appreciated!

0 Kudos
1 Reply
emedina
New Contributor III

As a workaround, what happens when you convert to a featureset and then try the save method? Like this:

test_fs = pd.Dataframe.spatial.to_featureset()
test_fs.save(
    save_location="path/to/your/location",
    out_name="test"
)

 

See here for more info on the method: https://developers.arcgis.com/python/api-reference/arcgis.features.toc.html?highlight=featureset#arc...

0 Kudos