I downloaded a shapefile where
province of the world are located (http://www.naturalearthdata.com/downloads/10m-cultural-vectors/10m-admin-1-states-provinces/).
Based on this I want to create a shapefile that only contains the countries.
Since its a pretty big shapefile, I want to do this with
*Note that I tried doing this in
QGIS which caused the programme to crash.
SELECT c.admin, ST_Union(geom) AS geom FROM contry_province_natural_earth_world_data c GROUP BY c.admin;
Obviously the geometry of the original shapefile is not an exact topolgy. I thought about using
ST_ExteriorRing to get only the outline. I am not sure what the result would look like. I tried, but using
ST_ExteriorRing() results in:
ExteriorRing: geom is not a polygon when I try it on one geometry.
Fixing the input geometry I could try to snap neighbouring polygonlines, but how to do this for every polygon?
ST_Snap() only works on two input geometries (as far as I understand the documentation). I somehow need to say "Snap every polygon to each other that is within a distance of XY".