My ultimate goal is this:
- Start with a CSV
- Turn that CSV into a spatial data frame
- Turn that spatial data frame into a feature layer - This is where I'm failing
- Append the data from that feature layer to another existing hosted feature layer
Step 1 works fine.
df = pd.read_csv("/arcgis/home/Chicago Homicide csv.csv")
#specifically changes a column to date and time
df['Date'] = pd.to_datetime(df['Date'])
#df.dtypes
df.head()Step 2 also works fine
#makes a sdf and specifies the xy coord columns
sdf = GeoAccessor.from_xy(df,'Longitude','Latitude')
#df.dtypes
sdf.head()
sdf.spatial.plot()
This is the third and failing step
sdf.spatial.to_featureLayer('sdf_to_featureLayer')
#this is the resulting error
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
/tmp/ipykernel_393/3728460398.py in <module>
----> 1 sdf.spatial.to_featureLayer('spf_to_featureLayer')
AttributeError: 'GeoAccessor' object has no attribute 'to_featureLayer'
I've been up and down forums in search of a solution, I actually used the answers from this post (ESRI community link) to get to where I am.
Any thoughts are much appreciated!