Depending on the actual similarity, you could probably get away with groups over a gridded centroid, e.g.
SELECT
ARRAY_AGG(id) AS ids,
ST_Union(geom) AS geom
FROM
data1
GROUP BY
ST_SnapToGrid(ST_Centroid(geom), <grid_size>)
;
where you just need to find a suitable <grid_size>
- start small, and increase slowly.