Hi,i have a 4 point bounding box and a grid (x,y,resolution). How can I determine which cells will this bounding box occupy as seen in the above image?
Asked
Active
Viewed 370 times
0
-
You want a list of x, y cell coordinates? – Tarik May 08 '21 at 11:15
-
yes, indices to be exact – frozt May 08 '21 at 11:17
-
You just have to loop through all the cells and check if they fall inside the rectangle. Plenty of algorithms available to do that. – Tarik May 08 '21 at 11:32
-
Can you name a library or share the code? – frozt May 08 '21 at 11:52
-
1A quick search gave this: https://www.geeksforgeeks.org/how-to-check-if-a-given-point-lies-inside-a-polygon/ – Tarik May 08 '21 at 12:53
-
thanks, i will try – frozt May 08 '21 at 13:41