[postgis-users] Interior rings

paul.malm at lfv.se paul.malm at lfv.se
Wed Aug 14 01:25:41 PDT 2019


Thanks Paul!

Från: postgis-users [mailto:postgis-users-bounces at lists.osgeo.org] För Paul Ramsey
Skickat: den 13 augusti 2019 17:16
Till: PostGIS Users Discussion
Ämne: Re: [postgis-users] Interior rings

You’re going to want to chain a ST_DumpRings (turn polygons to rings) to an ST_Dump (turn mutlis to singletons) and then look at the dump ring composite type and omit ring 1 from the relation…

Something like:


WITH
poly AS (
  SELECT 'MULTIPOLYGON(((0 0, 0 10, 10 10, 10 0, 0 0), (4 4, 4 5, 5 5, 5 4, 4 4)))'::geometry AS g
  ),
rings AS (
  SELECT (ST_DumpRings((ST_Dump(g)).geom)).* FROM poly
  )
SELECT * FROM rings
WHERE path != '{0}';


On Aug 13, 2019, at 7:39 AM, <paul.malm at lfv.se<mailto:paul.malm at lfv.se>> <paul.malm at lfv.se<mailto:paul.malm at lfv.se>> wrote:

Hi, I would like to create a table with all the interior rings (islands) from a table with multipolygons lakes.
I’ve only come this far:
CREATE TABLE "islands" AS SELECT  (ST_InteriorRingn(the_geom, 2)).geometry AS the_geom FROM public."lakes";
But this is only collecting the first island in each lake.
Thankful for any suggestions.
/Paul
_______________________________________________
postgis-users mailing list
postgis-users at lists.osgeo.org<mailto:postgis-users at lists.osgeo.org>
https://lists.osgeo.org/mailman/listinfo/postgis-users

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20190814/1e58ddb0/attachment.html>


More information about the postgis-users mailing list