I have MULTIPOLYGON
in my PostGIS database to store countries (with islands etc.). But I need to add holes to my borders for lakes. How can I store multipolygon with holes?
I am using ST_SetSRID(ST_Multi(ST_GeomFromText('POLYGON(...)')), 4326)
to create multipolygon
Best Answer
You can use ST_Difference to create the holes. It will subtract the lakes from your countries.
Let's say your lakes are in another table called lakes and you've already stored your countries. You would do something like