Hi @jcarlson ,
So I ended up going a different route. I transformed the data frame into a spatially enabled dataframe (sdf) and tried to simply plot the sdf using spatial.plot. The webmap shows another layer from AGOL but not the points from the sdf.
My goal is a simple point-in-polygon check to see if points fall within another layer's boundaries.
import arcgis
import os
import datetime as dt
import pandas as pd
from arcgis.gis import GIS
from arcgis.features import GeoAccessor, GeoSeriesAccessor
from numpy.random import rand
from arcgis.geometry import Geometry
from arcgis.geometry.filters import within
from arcgis.geometry.filters import contains
from arcgis.geocoding import geocode
from arcgis.geometry import lengths, areas_and_lengths, project
from arcgis.geometry import Point, Polyline, Polygon, Geometry
from arcgis.mapping import WebMap
# Loading in the Bight data
bight = pd.read_excel(r'C:\Users\GisUser\Desktop\bight2018_clean.xlsx', sheet_name = "grab", header = 0)
bight.columns = bight.columns.str.lower() # Lowercase all columns for consistency
bight
# Creating a spatially enabled dataframe from loaded data
sdf = GeoAccessor.from_xy(bight, 'latitude','longitude')
sdf
# Creating point object from the dataframe
pt = Point({"x": sdf["latitude"], "y": sdf["longitude"]})
# Calling on the Strata layer using portal item id
strata = gis.content.get('387791e1c66b4ae6bbadda60848ddecc')
strata
query1 = strata.layers[0].query()
resp1 = query1.features
resp1[0].geometry
strataLayer = Geometry(resp1[0].geometry)
strataLayer
# Create map / add layer to map
wm = gis.map("California")
wm.add_layer(strata)
wm
print(pt.within(strataLayer))
The output from both the "within" and "contains" function are "None" but I know there are points within the polygon. Any insight on how I can get this to script to work?