I have a text file containing coordinates in the form of:
[-1.38795678, 54.90352965]
[-3.2115, 55.95530556]
[0.00315428, 51.50285246]
I want to be able to iterate through each coordinate to check which polygon it is in (UK counties in a shapefile), however I am not sure how to tokenise the numbers so that I can have a code along the lines of...
for line in coordinates:
for poly in polygons:
if points in polygons:
print(polygons)
break
if points not in polygons:
continue
At the moment they are strings but I want to each line to be comprised of the two points so I that the program can try and locate them in a polygon.