How to count adjacent polygons in postgis

Viewed 42

I have a postgis sql query that fetches polygons from a table and merges adjacent polygons (that share an edge) into larger polygons.

SELECT (ST_DUMP(ST_UNION(ST_SNAPTOGRID(geom,0.0001)))).geom
FROM table;

How can I get the amount of adjacent polygons that are being merged for each superpolygon?

0 Answers
Related