I am curious how can I find all polygons that are touching with each other but are completely separate from the rest of the polygons is the same dataset, using PostGIS.
For better understanding I uploaded a picture.
I am curious how can I find all polygons that are touching with each other but are completely separate from the rest of the polygons is the same dataset, using PostGIS.
For better understanding I uploaded a picture.
You can merge touching polygons, see this answer:
https://stackoverflow.com/a/49970447/2816941
This will produce a layer for these "islands".
Then you can simply join back onto the islands from the original data using st_intersects(islands.geom, st_pointonsurface(original.geom))