AnsweredAssumed Answered

ArcGIS API for Python Spatially Enabled Data Frame broken with datetime fields

Question asked by Ben.Sperry_oxitec on Feb 12, 2019
Latest reply on Mar 26, 2019 by nlgis_max

I am trying to create a Spatially Enabled Data Frame object from a FeatureLayer object using the ArcGIS API for python version 1.5.3 and pandas version 0.24.1. When I use web layers that don't have date fields it works fine, but as soon as it has a date field it stops working and I get the following error:

 

Exception: Could not load the dataset: dtype '<class 'datetime.datetime'>' not understood

 

I copied the code directly from the Introduction to the Spatially Enabled Data Frame guide page and just substituted the item id for one of my own web layers. Here is my code:

 

from arcgis import GIS
gis = GIS("https://arcgis.com", ***, ***)
item = gis.content.get('The item id')
flayer = item.layers[0]

# create a Spatially Enabled DataFrame object
sdf = pd.DataFrame.spatial.from_layer(flayer)
sdf.head()

Any ideas? Has anyone else run into this problem?

Outcomes