help, i have two datasets a FGDB with a polygon feature class containing over 350k polygons and a csv file with an xy point of a little over 275k records.
using Arcgis api for python (on a computer that doesn't have any ESRI software like Pro or Desktop) i've successfully read the polygons into a spatial dataframe and read the csv file also into a spatial dataframe
but when i try and identify which points intersect the polygons i get this error:
i have tried a few other ways but non seem to work, even the documentation doesn't seem to help
any ideas?
Most likely that the points and polygons are in different coordinate systems and the extents don't overlap (last error message) . If this is the case, the csv needs to be converted with a know coordinate system to something that the coordinate systems are know and/or the same
Hi Dan, thanks for that, i checked and both have the same coordinate system with then wkid of 27700.
from manually doing the intersection in Pro on another computer around 260k of the points fall within polygons
i did also try this method i found on another post and this looks more promising but flags some geometry issues which i need to work out how to fix...
Hi @StuartMoore
You could use spatial join.
# Load point and polygon spatial dataframes
points_gdf = gpd.read_file('path_to_points.shp')
polygons_gdf = gpd.read_file('path_to_polygons.shp')
# Perform spatial join
intersection = gpd.sjoin(points_gdf, polygons_gdf, how="inner", op='intersects')
# intersection dataframe will contain points that intersect with polygons
print(intersection)
thanks i tried that but thats where i was getting the geometry issues