So I have second level administration data of a country with shapes in a PostGIS database. Now I actually need the first level administration level representation of the country, but here I only have the name of that first level admin and the names of its subdivisions as a text file (which do not need to match completely with the names I have in the DB).
Now I would like to manually remove the admin2 data entries and replace them with the admin 1 data. However, for the geometry column I was thinking to do a
ST_UNION by ids of the admin 2 areas of one admin1 area. Is this possible? Right now there is no indicator of shared admin 1 information in the DB. Something like:
ST_UNION((SELECT geom FROM states WHERE id IN (1,2,3,4)))