I have a rectangle polygon which divides my country into small grids (like tiling). I have a system in which by selecting single/multiple features users can send applications to get license to those single/multiple selected polygons. But there is one requirement. All selected features must be in neighborhood (must intersect with wall, edge intersection is not considered). For example, if user selected these like this
the system should say ok (true), because all polygons have connections.
If user selections like this:
then, it checking algorithm should say that it is not ok (false), because the upper-left polygon does not intersect with its walls, which means edge intersection is not counted. Same conclusion applies to the last image, I should get False.
Are there any ready functions/algorithms to check such conditions? I am looking for PostGIS solutions/recommendations. Users will select polygons from the drop-down list and press the check button to see the results.
(col, row)
as keys in a map (with altering(col+-1, row+-1)
) of previously selected.