This article mentions that a Spatial DataFrame can be created from a local feature class using the ArcGIS API for python:
"If the ArcPy module is installed, meaning you have installed ArcGIS Pro and have installed the ArcGIS API for Python in that same environment, the SpatialDataFrame has methods to read a subset of the ArcGIS Desktop supported geographic formats, most notably:
ArcGIS Server Web Services and ArcGIS Online Hosted Feature Layers
OGC Services "
The article goes through an example where they construct a SDF using a local path to a shape file, but I'd like to build a spatial dataframe from a feature layer coming from a map in a ArcGIS pro project. Does anyone know how one could do this?
I've looked into the documentation for the API. The arcgis.features module has the SpatialDataFrame object and a constructor method called "from_layer", but I am not sure how to pass a FeatureLayer object to it. Is there a way to construct a FeatureLayer object from a local feature layer?
I was able to host the feature layer on AGOL and then create the spatial data frame from there, but I'd like to bypass having to host it.