Hi Guys,
Attempting to use the new "Spatially Enabled DataFrame " after getting familiar with Spatial Dataframes.
The new version seems to have some functionality of "Spatial" queries stripped out ? There's no "within", "contains", "touches" etc. at a DataFrame level only at Series level?
example:
gis = GIS("url", "user", password)
content=gis.content.get("ID")
layers=content.layers
points=pd.DataFrame.spatial.from_layer(layers[0])
polygons=pd.DataFrame.spatial.from_layer(layers[1])
if I try to take a polygon and find what points are within it I can no longer run a single query
as such :
Using SpatialDataFrame I Can use this piece of code:
a_polygon=polygons.ix[0]
result = points.within(a_polygon.SHAPE) ## returns true/false for each point denoting if inside the polygon.
points_inside_polygon= points.loc[result] ## gives total list of points inside of the polygon.
is there still a way to run a group query as I can only run a one by one test ?
Ex:
points.ix[0].SHAPE.within(polygons.ix[0].SHAPE) ## returns true/false if single point is within the polygon
Using version 1.5.2 of ArcGis.
Also all the examples using the spatially Enabled DataFrame from your documentation are using simple SQL queries on the text fields. Spatial queries should be based on the geometries not the fields associated with geometries.