Convert polygon with filled region inside hole into multiple polygonsHow to estimate the average width of a...

How can I differentiate duration vs starting time

Why can't I set the 'prototype' of a function created using 'bind'?

filecontents: select rows of group to display

How long can the stop in a stop-and-go be?

Is practicing on a digital piano harmful to an experienced piano player?

How to wrap a figure in exam document?

How long does it take to mine rock?

How bad is a Computer Science course that doesn't teach Design Patterns?

Is there a way to pause a running process on Linux systems and resume later?

Can I benefit from a feat effect whilst polymorphed?

Is it possible to have the same planeswalker from different editions in a Commander deck?

Finding the index of a specific element in a list

How can I handle players killing my NPC outside of combat?

Trying to use an LCD 1602 to display, but I don't have a 10 KOhm potentiometer

How unreachable are Jupiter's moons from Mars with the technology developed for going to Mars?

What is an explicit bijection in combinatorics?

Is Screenshot Time-tracking Common?

How can guns be countered by melee combat without raw-ability or exceptional explanations?

Expression for "unconsciously using words (or accents) used by a person you often talk with or listen to"?

How to regain lost focus?

Is "accuse people to be racist" grammatical?

In the Lost in Space intro why was Dr. Smith actor listed as a special guest star?

Buying a "Used" Router

How to write Muḥammad ibn Mūsā al-Khwārizmī?



Convert polygon with filled region inside hole into multiple polygons


How to estimate the average width of a sidewalk?Getting ST_Difference between two different tables in postgisAdjusting polygons to boundary and filling holesMerge overlapping GeoJSON GeometryCollectionsPolygon intersection with LineString in PostGisPostGIS help writing a ST_MakeSimple method for self intersecting lines?How to calculate the start and end lat/lon of a linestring which is not a part of a ST_buffer?Obtaining Each Unique Area of Overlapping Polygons in Postgres 9.6/Postgis 2.3Filling holes by acres threshold using PostGIS?Osm2pgsql - Lines instead of polygons that represent buildings













0















Suppose you have a polygon with an inner ring representing a hole, and inside that hole is another inner ring (an "island"):



Polygon with filled region inside hole



The above shape can be generated using:



SELECT
ST_MakePolygon(
ST_ExteriorRing(ST_Buffer(center, 10, 10)),
ARRAY[
ST_ExteriorRing(ST_Buffer(center, 6, 6)),
ST_ExteriorRing(ST_Buffer(center, 3, 3))
]
) AS geom
FROM ST_MakePoint(0, 0) AS center;


While this can be represented as a single polygon, I have a requirement to convert this into multiple polygons. I am working with a library that supports polygons with holes, but does not support "islands" inside those holes - thus, I need to be able to extract those islands into separate polygons. And in case those islands also have holes that have even more "inner" islands - I need to be able to be able to extract those inner islands as well, such that no polygon in the result set contains "islands". Multiple holes (inner rings) are allowed - just no islands inside any of those holes (no inner ring wholly contained inside another inner ring).



How can I achieve this using PostGIS?



Also just to expand my knowledge... is there a more precise terminology I can use instead of "island"? I'm aware of "inner ring", but an inner ring can represent either a hole, or an "island" inside a hole. Just wondering if there is a more specific term for when an inner ring represents an island vs a hole.









share



























    0















    Suppose you have a polygon with an inner ring representing a hole, and inside that hole is another inner ring (an "island"):



    Polygon with filled region inside hole



    The above shape can be generated using:



    SELECT
    ST_MakePolygon(
    ST_ExteriorRing(ST_Buffer(center, 10, 10)),
    ARRAY[
    ST_ExteriorRing(ST_Buffer(center, 6, 6)),
    ST_ExteriorRing(ST_Buffer(center, 3, 3))
    ]
    ) AS geom
    FROM ST_MakePoint(0, 0) AS center;


    While this can be represented as a single polygon, I have a requirement to convert this into multiple polygons. I am working with a library that supports polygons with holes, but does not support "islands" inside those holes - thus, I need to be able to extract those islands into separate polygons. And in case those islands also have holes that have even more "inner" islands - I need to be able to be able to extract those inner islands as well, such that no polygon in the result set contains "islands". Multiple holes (inner rings) are allowed - just no islands inside any of those holes (no inner ring wholly contained inside another inner ring).



    How can I achieve this using PostGIS?



    Also just to expand my knowledge... is there a more precise terminology I can use instead of "island"? I'm aware of "inner ring", but an inner ring can represent either a hole, or an "island" inside a hole. Just wondering if there is a more specific term for when an inner ring represents an island vs a hole.









    share

























      0












      0








      0








      Suppose you have a polygon with an inner ring representing a hole, and inside that hole is another inner ring (an "island"):



      Polygon with filled region inside hole



      The above shape can be generated using:



      SELECT
      ST_MakePolygon(
      ST_ExteriorRing(ST_Buffer(center, 10, 10)),
      ARRAY[
      ST_ExteriorRing(ST_Buffer(center, 6, 6)),
      ST_ExteriorRing(ST_Buffer(center, 3, 3))
      ]
      ) AS geom
      FROM ST_MakePoint(0, 0) AS center;


      While this can be represented as a single polygon, I have a requirement to convert this into multiple polygons. I am working with a library that supports polygons with holes, but does not support "islands" inside those holes - thus, I need to be able to extract those islands into separate polygons. And in case those islands also have holes that have even more "inner" islands - I need to be able to be able to extract those inner islands as well, such that no polygon in the result set contains "islands". Multiple holes (inner rings) are allowed - just no islands inside any of those holes (no inner ring wholly contained inside another inner ring).



      How can I achieve this using PostGIS?



      Also just to expand my knowledge... is there a more precise terminology I can use instead of "island"? I'm aware of "inner ring", but an inner ring can represent either a hole, or an "island" inside a hole. Just wondering if there is a more specific term for when an inner ring represents an island vs a hole.









      share














      Suppose you have a polygon with an inner ring representing a hole, and inside that hole is another inner ring (an "island"):



      Polygon with filled region inside hole



      The above shape can be generated using:



      SELECT
      ST_MakePolygon(
      ST_ExteriorRing(ST_Buffer(center, 10, 10)),
      ARRAY[
      ST_ExteriorRing(ST_Buffer(center, 6, 6)),
      ST_ExteriorRing(ST_Buffer(center, 3, 3))
      ]
      ) AS geom
      FROM ST_MakePoint(0, 0) AS center;


      While this can be represented as a single polygon, I have a requirement to convert this into multiple polygons. I am working with a library that supports polygons with holes, but does not support "islands" inside those holes - thus, I need to be able to extract those islands into separate polygons. And in case those islands also have holes that have even more "inner" islands - I need to be able to be able to extract those inner islands as well, such that no polygon in the result set contains "islands". Multiple holes (inner rings) are allowed - just no islands inside any of those holes (no inner ring wholly contained inside another inner ring).



      How can I achieve this using PostGIS?



      Also just to expand my knowledge... is there a more precise terminology I can use instead of "island"? I'm aware of "inner ring", but an inner ring can represent either a hole, or an "island" inside a hole. Just wondering if there is a more specific term for when an inner ring represents an island vs a hole.







      postgis





      share












      share










      share



      share










      asked 6 mins ago









      Sergey KSergey K

      1484




      1484






















          0






          active

          oldest

          votes











          Your Answer








          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "79"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: false,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fgis.stackexchange.com%2fquestions%2f313343%2fconvert-polygon-with-filled-region-inside-hole-into-multiple-polygons%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          0






          active

          oldest

          votes








          0






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes
















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Geographic Information Systems Stack Exchange!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fgis.stackexchange.com%2fquestions%2f313343%2fconvert-polygon-with-filled-region-inside-hole-into-multiple-polygons%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Щит и меч (фильм) Содержание Названия серий | Сюжет |...

          is 'sed' thread safeWhat should someone know about using Python scripts in the shell?Nexenta bash script uses...

          Meter-Bus Содержание Параметры шины | Стандартизация |...