I have a huge point dataset with almost 300.000 points and I want to intersect them with a country geometry that has a complex geometry (multiple islands and borders). What I've done so far is to construct a GeoPandas dataframe and then clip it, however the process takes almost 50 minutes whereas if I perform the same task with ArcGIS the entire process takes only 43 seconds. I've been searching for a way to improve the process without success.
gdf = gpd.GeoDataFrame(
merged_data,
crs='EPSG:4326',
geometry=[Point(xy) for xy in zip(merged_data.longitude, merged_data.latitude)])
poly = country_boundary.geometry.unary_union
points_clip = gdf[gdf.geometry.intersects(poly)]