I have a shapefile of all the counties that make up my state. Using the shapefile (which contains geometric for the district polygons) I was able to use geopandas to plot the shapes in a figure. I have some addresses that I have geocoded into latitude and longitude coordinates and I'd like to be able to determine which county (or polygon) the coordinates are within. I see that geopandas has a within
function, but I don't quite understand how to use it.
The end goal will be for a user to input and address and the program returns the county name. There are only a few dozen counties so I was thinking of using a for loop to iterate through the rows and check each polygon to see if the provided coordinate lies within.