2

I have a bunch of grids (100x100m) and I need to remove some of them considering the linear shape that forms some sets forms.

enter image description here

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?

Vince
  • 20,017
  • 15
  • 45
  • 64
J.Patordi
  • 313
  • 2
  • 11
  • @BERA exactly, a hole country. – J.Patordi Jan 19 '23 at 16:00
  • 1
  • For this kind of question, it would be good to share sample data for testing - otherwise one first has to create an own project that takes some time, before even trying a solution. 2) You should provide a clear definition (condition) when a cell should be deleted. This is unclear to me. You marked some cells with 3 neighbouring cells to be deleted, where in other cases cells with two neighbours are not marked for deletion.
  • – Babel Jan 19 '23 at 20:38