Overwrite method not working, and type error returned when loading a spatial data frame to a feature class

166
0
08-16-2018 10:12 AM
annegrimes2
New Contributor II

I am trying to overwrite a feature layer in AGOL using the Python api. However, the wrong number of records are returned.

See this previous post Overwrite not working, wrong number of records returned 

It does not seem like this issue has been resolved as of yet.

So I tried to use the edit method instead. However it is returning a type error when I use a polygon layer. (it works fine with point files, it is only problematic with non-point files)

sdf1 = SpatialDataFrame.from_featureclass(r'C:\Users\me\Documents\ArcGIS\Saved.gdb\Open_Space')

fs = sdf1.to_featureset()
parcel.edit_features(adds=fs)

Error:

File "C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\site-packages\arcgis\features\_data\geodataset\geodataframe.py", line 1349, in from_featureclass
return from_featureclass(filename=filename, **kwargs)
File "C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\site-packages\arcgis\features\_data\geodataset\io\fileops.py", line 213, in from_featureclass
if row[geom_idx].type in ['polyline', 'polygon']:
AttributeError: 'NoneType' object has no attribute 'type'

Thanks Anne

0 Kudos
0 Replies