I have a bunch of grids (100x100m) and I need to remove some of them considering the linear shape that forms some sets forms.
I've blue circled the set of grids I need to remove.
What I thought since now is to count the number of adjacent vertex of each one of the grids. Considering that a square has 4 vertex, if a grid only share two sides (having the id of 2 different grids 4 times one for each vertex shared) that means only have 2 adjancents grids what forms the linear shape. I thought as well dissolving the grid by his adjacents to set the sets of geometries (1, 2, 3 in image) to remove the whole grids with a dissolved geometry. Also if I do a dissolve, I could aggregate the total number of vertex and get a score considering how many vertex the grid shares.
Any theorical ideas or any script/tool you know that do something similar?