Changes between Initial Version and Version 1 of Ticket #10823, comment 2


Ignore:
Timestamp:
Mar 24, 2015, 9:58:17 AM (8 years ago)
Author:
mkaravel

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #10823, comment 2

    initial v1  
    11Hi Johan.
    22
    3 According to the OGC standard the outer and inner rings of a polygon must be simple rings (the standard uses the term "LinearRing" for this). As such, a ring of a polygon cannot touch itself.
     3According to the OGC standard the outer and inner rings of a polygon must be simple rings (the standard uses the term '''LinearRing''' for these). As such, a ring of a polygon cannot touch itself.
    44
    55This is what is implemented in Boost.Geometry (a bit relaxed though as we do allow for duplicate consecutive points). For your polygon to be valid, you need to define the inner ring separately; see the following WKT:
    6           POLYGON((0 3,3 3,3 1,2 1,2 0,0 0,0 3),(2 1,2 2,1 2,1 1,2 1))
     6
     7{{{          POLYGON((0 3,3 3,3 1,2 1,2 0,0 0,0 3),(2 1,2 2,1 2,1 1,2 1))}}}
    78
    89I have also attached a small program exhibiting what I am claiming above; if you re-define your polygon as per the WKT above, it is detected as valid.