I have grids as polygons where the grids are overlapping. I want list of grids covering a separate polygon. The image below demonstrate the problem. The red lines are the edges of the grids and the black polygon is polygon of our interest.

enter image description here

Since the grids are overlapping simple intersect will generate a list where some grids add to spatial redundancy. I want to optimize size this list by removing the grids which only contribute to the spatial redundancy. For example, in the following image the skyblue polygon will intersect with four surrounding grids, but the expected output is a single grid (any one of the four intersecting grid).

enter image description here

As mentioned, solution in this case may not be unique, what is expected here any of the all possible solution where count of grids in the solution is minimized.

  • If you can load your data to a database this sounds like the kind of question that is best answered using a spatial query in PostGIS. Programmatically with Python you could use the shapely intersect() function and just get the first returned result. – cokrzys Oct 9 '19 at 1:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.