I have a bunch of .csv files with coordinates and a polygon. In my standalone script I would like to check if the polygon intersects with the coordinates.
So, when I write:
for feature in polygon.getFeatures():
if feature.geometry().intersects(file.geometry()):
It doesn't work because the coordinates in my 'file' are of type string and not a QGIS Rectangle.
I can use numpy to sort of get the extent of the coordinates as string by writing:
data = np.genfromtxt(file, delimiter=" ")
x = data[:, 0]
y = data[:, 1]
xmin = min(x)
xmax = max(x)
ymin = min(y)
ymax = max(y)
I feel like I have all the extents but now I need to find a way to check if they intersect. I'm stuck at this point. How can I do this?
I'm using QGIS 3.10.