When does Shapely's “polygonize_full” detect a dangle?Finding Nearest Line Segments to Point using...

Why would the Red Woman birth a shadow if she worshipped the Lord of the Light?

Why no variance term in Bayesian logistic regression?

Examples of smooth manifolds admitting inbetween one and a continuum of complex structures

Unable to supress ligatures in headings which are set in Caps

I would say: "You are another teacher", but she is a woman and I am a man

How much of data wrangling is a data scientist's job?

Is it logically or scientifically possible to artificially send energy to the body?

One verb to replace 'be a member of' a club

What is the idiomatic way to say "clothing fits"?

Cursor Replacement for Newbies

Why is consensus so controversial in Britain?

If human space travel is limited by the G force vulnerability, is there a way to counter G forces?

Valid term from quadratic sequence?

What does “the session was packed” mean in this context?

Which is the best way to check return result?

Can I run a new neutral wire to repair a broken circuit?

Why is it a bad idea to hire a hitman to eliminate most corrupt politicians?

Extract rows of a table, that include less than x NULLs

Plagiarism or not?

How badly should I try to prevent a user from XSSing themselves?

Arrow those variables!

Unlock My Phone! February 2018

GFCI outlets - can they be repaired? Are they really needed at the end of a circuit?

Why can't we play rap on piano?



When does Shapely's “polygonize_full” detect a dangle?


Finding Nearest Line Segments to Point using shapely?Equivalent function to shapely's envelope in ogr?Speed up row-wise point in polygon with GeopandasEnforce topology rule over a shapefileGDAL/OGR ogr.Layer.Intersection fails when producing mixed geometry resultsWhy is Shapely's snapping (GEO snaps) not working as expected?Make ST_Polygonize in Postgis return dangles, cuts and invalid ringsIntersection with Shapely and Fiona gives Key ErrorIdentifying road segments completely cut off by polygon using QGIS?Is this a bug in Shapely's ops.snap?













2















Shapely's polygonize_full operation, which merges line segments into polygons, returns four geometry collections: polygons, dangles, cuts and invalid ring lines. Dangles are defined in the documentation as "edges which have one or both ends which are not incident on another edge endpoint", while cuts are "connected at both ends but do not form part of polygon".



I assumed that the following code, which tries to polygonize a square with one edge missing, should find two dangles and one cut edge:



import shapely

lines = [
((0,0),(1,0)),
((1,0),(1,1)),
((1,1),(0,1))
]

polygons, dangles, cuts, invalids = shapely.ops.polygonize_full(lines)


However, the polygons, dangles and invalids collections are all empty, while the cuts collection contains the three original edges:



[str(cut) for cut in cuts]
# This returns ['LINESTRING (1 1, 0 1)', 'LINESTRING (1 0, 1 1)', 'LINESTRING (0 0, 1 0)']


When does polygonize_full detect a dangle? Is there a way to get the dangling edges in my test case (0 0, 1 0 and 1 1, 0 1) using Shapely?










share|improve this question





























    2















    Shapely's polygonize_full operation, which merges line segments into polygons, returns four geometry collections: polygons, dangles, cuts and invalid ring lines. Dangles are defined in the documentation as "edges which have one or both ends which are not incident on another edge endpoint", while cuts are "connected at both ends but do not form part of polygon".



    I assumed that the following code, which tries to polygonize a square with one edge missing, should find two dangles and one cut edge:



    import shapely

    lines = [
    ((0,0),(1,0)),
    ((1,0),(1,1)),
    ((1,1),(0,1))
    ]

    polygons, dangles, cuts, invalids = shapely.ops.polygonize_full(lines)


    However, the polygons, dangles and invalids collections are all empty, while the cuts collection contains the three original edges:



    [str(cut) for cut in cuts]
    # This returns ['LINESTRING (1 1, 0 1)', 'LINESTRING (1 0, 1 1)', 'LINESTRING (0 0, 1 0)']


    When does polygonize_full detect a dangle? Is there a way to get the dangling edges in my test case (0 0, 1 0 and 1 1, 0 1) using Shapely?










    share|improve this question



























      2












      2








      2








      Shapely's polygonize_full operation, which merges line segments into polygons, returns four geometry collections: polygons, dangles, cuts and invalid ring lines. Dangles are defined in the documentation as "edges which have one or both ends which are not incident on another edge endpoint", while cuts are "connected at both ends but do not form part of polygon".



      I assumed that the following code, which tries to polygonize a square with one edge missing, should find two dangles and one cut edge:



      import shapely

      lines = [
      ((0,0),(1,0)),
      ((1,0),(1,1)),
      ((1,1),(0,1))
      ]

      polygons, dangles, cuts, invalids = shapely.ops.polygonize_full(lines)


      However, the polygons, dangles and invalids collections are all empty, while the cuts collection contains the three original edges:



      [str(cut) for cut in cuts]
      # This returns ['LINESTRING (1 1, 0 1)', 'LINESTRING (1 0, 1 1)', 'LINESTRING (0 0, 1 0)']


      When does polygonize_full detect a dangle? Is there a way to get the dangling edges in my test case (0 0, 1 0 and 1 1, 0 1) using Shapely?










      share|improve this question
















      Shapely's polygonize_full operation, which merges line segments into polygons, returns four geometry collections: polygons, dangles, cuts and invalid ring lines. Dangles are defined in the documentation as "edges which have one or both ends which are not incident on another edge endpoint", while cuts are "connected at both ends but do not form part of polygon".



      I assumed that the following code, which tries to polygonize a square with one edge missing, should find two dangles and one cut edge:



      import shapely

      lines = [
      ((0,0),(1,0)),
      ((1,0),(1,1)),
      ((1,1),(0,1))
      ]

      polygons, dangles, cuts, invalids = shapely.ops.polygonize_full(lines)


      However, the polygons, dangles and invalids collections are all empty, while the cuts collection contains the three original edges:



      [str(cut) for cut in cuts]
      # This returns ['LINESTRING (1 1, 0 1)', 'LINESTRING (1 0, 1 1)', 'LINESTRING (0 0, 1 0)']


      When does polygonize_full detect a dangle? Is there a way to get the dangling edges in my test case (0 0, 1 0 and 1 1, 0 1) using Shapely?







      python topology shapely geometry-conversion






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Jun 20 '17 at 20:34







      Jake

















      asked Jun 20 '17 at 20:27









      JakeJake

      4,9202336




      4,9202336






















          1 Answer
          1






          active

          oldest

          votes


















          0














          This is an old question, but:
          polygonize_full will not introduce (in my understanding) edges. Thus, it will not close a polygon. What it does is it generates polygons from line segments, introducing nodes where two segments intersect. Yet, they still need to be able to close the polygon with (sub)segments from the original input. In your input, the shape is a reversed "C", which is open, and forms no polygon.





          share
























            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%2f244726%2fwhen-does-shapelys-polygonize-full-detect-a-dangle%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown

























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            0














            This is an old question, but:
            polygonize_full will not introduce (in my understanding) edges. Thus, it will not close a polygon. What it does is it generates polygons from line segments, introducing nodes where two segments intersect. Yet, they still need to be able to close the polygon with (sub)segments from the original input. In your input, the shape is a reversed "C", which is open, and forms no polygon.





            share




























              0














              This is an old question, but:
              polygonize_full will not introduce (in my understanding) edges. Thus, it will not close a polygon. What it does is it generates polygons from line segments, introducing nodes where two segments intersect. Yet, they still need to be able to close the polygon with (sub)segments from the original input. In your input, the shape is a reversed "C", which is open, and forms no polygon.





              share


























                0












                0








                0







                This is an old question, but:
                polygonize_full will not introduce (in my understanding) edges. Thus, it will not close a polygon. What it does is it generates polygons from line segments, introducing nodes where two segments intersect. Yet, they still need to be able to close the polygon with (sub)segments from the original input. In your input, the shape is a reversed "C", which is open, and forms no polygon.





                share













                This is an old question, but:
                polygonize_full will not introduce (in my understanding) edges. Thus, it will not close a polygon. What it does is it generates polygons from line segments, introducing nodes where two segments intersect. Yet, they still need to be able to close the polygon with (sub)segments from the original input. In your input, the shape is a reversed "C", which is open, and forms no polygon.






                share











                share


                share










                answered 1 min ago









                MartinTMartinT

                38919




                38919






























                    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%2f244726%2fwhen-does-shapelys-polygonize-full-detect-a-dangle%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

                    (145452) 2005 RN43 Классификация | Примечания | Ссылки |...

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

                    Энтрерриос (город) Содержание История | Географическое...