L - linear-ring bowtie
LINEARRING(0 0, 100 100, 100 0, 0 100, 0 0)
false
L - linestring bowtie
LINESTRING(0 0, 100 100, 100 0, 0 100, 0 0)
true
P - point
POINT(10 10)
true
P - empty point
POINT EMPTY
true
P - point with invalid X ordinate
POINT(NaN 10)
false
P - point with invalid Y ordinate
POINT(10 NaN)
false
mP - no repeated points
MULTIPOINT((10 10), (20 20), (30 30))
true
P - repeated points
MULTIPOINT((10 10), (20 20), (30 30), (10 10))
true
L - no repeated points
LINESTRING (40 180, 120 120, 140 200, 200 140, 240 200)
true
L - invalid ordinate
LINESTRING (40 180, 120 120, 140 200, 200 140, NaN 200)
false
L - repeated points
LINESTRING (40 180, 120 120, 140 200, 140 200, 200 140, 240 200)
true
L - linestring with two identical points
LINESTRING(0 0, 0 0)
false
mL - MultiLinestring with two identical points in first component
MULTILINESTRING((1 1, 0 0), (0 0, 0 0))
false
mL - MultiLinestring with two identical points in second component
MULTILINESTRING((1 1, 0 0), (0 0, 0 0))
false
A - zero-area polygon
POLYGON ((0 0, 0 0, 0 0, 0 0, 0 0))
false
A - polygon with too few points
POLYGON ((0 0, 10 0, 20 0, 0 0, 0 0))
false
A - polygon with invalid point
POLYGON ((0 0, 10 NaN, 20 0, 0 10, 0 0))
false
A - polygon with repeated point
POLYGON ((107 246, 107 246, 250 285, 294 137, 151 90, 15 125, 157 174, 107 246))
true
A - polygon with degenerate hole ring (A-B-A)
POLYGON ((0 0, 0 240, 260 240, 260 0, 0 0),
(220 200, 40 200, 40 20, 40 200, 220 200, 220 200))
false
mA - multipolygon with component with too few points
MULTIPOLYGON ( ((100 20, 180 20, 180 100, 100 100, 100 20)),
((20 100, 100 100, 100 180, 20 180, 20 100)),
((100 180, 180 180, 180 260, 100 260, 100 180)),
((180 100, 180 180, 180 180, 180 100)))
false
A - polygon self-intersects at non-vertex
POLYGON ((0 40, 0 0, 40 40, 40 0, 0 40))
false
A - polygon self-intersects at vertex
MULTIPOLYGON ( ((0 40, 20 20, 40 0, 40 40, 20 20, 0 0, 0 40)) )
false
A - polygon self-intersects at vertex/non-vertex
POLYGON ((0 40, 20 20, 40 0, 40 40, 0 0, 0 40))
false
A - hole self-intersects at non-vertex
POLYGON ((-10 50, 50 50, 50 -10, -10 -10, -10 50), (0 40, 0 0, 40 40, 40 0, 0 40))
false
A - polygon self-intersects at vertex
POLYGON ((-10 50, 50 50, 50 -10, -10 -10, -10 50), (0 40, 20 20, 40 0, 40 40, 20 20, 0 0, 0 40))
false
A - polygon self-intersects at vertex/non-vertex
POLYGON ((-10 50, 50 50, 50 -10, -10 -10, -10 50), (0 40, 20 20, 40 0, 40 40, 0 0, 0 40))
false
A - Valid doughnut
POLYGON ((0 60, 0 0, 60 0, 60 60, 0 60), (20 40, 20 20, 40 20, 40 40, 20 40))
true
A - shell has repeated points
POLYGON ((0 60, 0 0, 0 0, 60 0, 60 60, 0 60), (20 40, 20 20, 40 20, 40 40, 20 40))
true
A - shell touches hole without crossing it (valid)
POLYGON ((0 60, 0 0, 60 0, 60 60, 0 60), (20 40, 20 20, 60 20, 20 40))
true
A - shell touches hole without crossing it, but does so twice (invalid)
POLYGON ((0 60, 0 0, 60 0, 60 60, 0 60), (0 40, 20 20, 60 20, 0 40))
false
A - hole touches hole without crossing it (valid)
POLYGON ((0 120, 0 0, 140 0, 140 120, 0 120), (100 100, 100 20, 120 20, 120 100, 100 100), (20 100, 20 40, 100 40, 20 100))
true
A - holel touches hole without crossing it, but does so twice (invalid)
POLYGON ((0 120, 0 0, 140 0, 140 120, 0 120),
(100 100, 100 20, 120 20, 120 100, 100 100),
(20 100, 20 40, 100 40, 80 60, 100 80, 20 100))
false
A - hole touches hole without crossing it, but does so at an infinite number of points (invalid)
POLYGON ((0 120, 0 0, 140 0, 140 120, 0 120),
(100 100, 100 20, 120 20, 120 100, 100 100),
(20 100, 20 40, 100 40, 100 80, 20 100))
false
A - spike (invalid)
POLYGON ((0 60, 0 0, 60 0, 60 20, 100 20, 60 20, 60 60, 0 60))
false
A - puncture (invalid)
POLYGON ((0 60, 0 0, 60 0, 60 20, 20 20, 60 20, 60 60, 0 60))
false
A - hole within a hole (invalid)
POLYGON ((0 140, 0 0, 180 0, 180 140, 0 140), (20 20, 160 20, 160 120, 20 120, 20 20), (40 100, 40 40, 140 40, 140 100, 40 100))
false
A - empty shell and holes (valid)
POLYGON (EMPTY, EMPTY, EMPTY)
true
A - hole overlapping shell at non-vertex
POLYGON ((60 280, 260 180, 60 80, 60 280),
(140 80, 120 180, 200 180, 140 80))
false
A - shell self-overlaps
POLYGON ((60 340, 60 100, 340 100, 340 280, 340 200, 340 340, 60 340))
false
A - hole with repeated points
POLYGON ((40 260, 40 60, 120 60, 180 160, 240 60, 300 60, 300 260, 40 260),
(70 230, 80 230, 80 220, 80 220, 70 230))
true
A - hole outside but adjacent to shell
POLYGON ((40 260, 40 60, 120 60, 180 160, 240 60, 300 60, 300 260, 40 260),
(180 160, 240 60, 120 60, 180 160))
false
A - hole touches shell at two points
POLYGON ((240 260, 40 260, 40 80, 240 80, 240 260),
(140 180, 40 180, 140 260, 140 180))
false
A - hole touches shell at one non-vertex point
POLYGON ((240 260, 40 260, 40 80, 240 80, 240 260),
(140 180, 40 180, 140 240, 140 180))
true
A - hole touches shell at one vertex point
POLYGON ((240 260, 40 260, 40 80, 240 80, 240 260),
(140 180, 40 260, 140 240, 140 180))
true
A - hole outside shell
POLYGON ((20 180, 20 20, 140 20, 140 180, 20 180),
(160 120, 180 100, 160 80, 160 120))
false
A - hole identical to shell
POLYGON ((20 180, 20 20, 140 20, 140 180, 20 180),
(20 180, 20 20, 140 20, 140 180, 20 180))
false
A - hole identical to shell
POLYGON ((20 180, 20 20, 140 20, 140 180, 20 180),
(20 180, 20 20, 140 20, 140 180, 20 180))
false
A - hole self-intersects
POLYGON ((380 340, 40 340, 40 20, 380 20, 380 340),
(120 300, 300 280, 320 200, 160 140, 200 80, 320 120, 320 200, 360 60, 120 40, 120 300))
false
A - holes overlap, first point is identical
POLYGON ((20 320, 260 320, 260 20, 20 20, 20 320),
(140 280, 80 100, 200 100, 140 280),
(140 280, 40 80, 240 80, 140 280))
false
A - holes do not overlap, first point is identical
POLYGON ((20 320, 240 320, 240 40, 20 40, 20 320),
(140 180, 60 120, 60 240, 140 180),
(140 180, 200 120, 200 240, 140 180))
true
A - shell self-touches at vertex
POLYGON ((340 320, 340 200, 200 280, 200 80, 340 200, 340 20, 60 20, 60 340, 340 320))
false
A - shell self-touches at non-vertex
POLYGON ((300 320, 300 220, 260 260, 180 220, 360 220, 360 140, 120 140, 120 320, 300 320))
false
A - chain of holes surrounds an island inside the polygon
POLYGON ((40 300, 40 20, 280 20, 280 300, 40 300),
(120 240, 80 180, 160 220, 120 240),
(220 240, 160 220, 220 160, 220 240),
(160 100, 80 180, 100 80, 160 100),
(160 100, 220 160, 240 100, 160 100))
false
A - chain of holes splits polygon in two (touching at vertices)
POLYGON ((40 320, 340 320, 340 20, 40 20, 40 320),
(100 120, 40 20, 180 100, 100 120),
(200 200, 180 100, 240 160, 200 200),
(260 260, 240 160, 300 200, 260 260),
(300 300, 300 200, 340 320, 300 300))
false
A - chain of holes splits polygon in two (touching at non-vertex)
POLYGON ((40 320, 340 320, 340 20, 40 20, 40 320),
(100 120, 40 20, 180 100, 100 120),
(200 200, 180 100, 240 160, 200 200),
(260 260, 240 160, 300 200, 260 260),
(300 300, 300 200, 340 260, 300 300))
false
A - holes touch in one point
POLYGON ((190 190, 360 20, 20 20, 190 190),
(90 50, 150 110, 190 50, 90 50),
(190 50, 230 110, 290 50, 190 50))
true
A - holes touch in one point
POLYGON ((190 190, 360 20, 20 20, 190 190),
(90 50, 150 110, 190 50, 90 50),
(190 50, 230 110, 290 50, 190 50))
true
A - one holes touches another at all vertices
POLYGON( (0 0, 0 5, 6 5, 6 0, 0 0), (2 1, 4 1, 3 2, 2 1), (2 1, 1 4, 5 4, 4 1, 4 3, 3 2, 2 3, 2 1) )
false
A - one holes touches another at several vertices
POLYGON ((0 0, 0 5, 6 5, 6 0, 0 0),
(2.5 1, 3.5 1, 3.5 2, 2.5 2, 2.5 1),
(2.5 1.5, 1 4, 5 4, 3.5 1.5, 4 3, 3 2, 2 3, 2.5 1.5))
false
A - hole disconnects interiors
POLYGON ((0 0, 10 10, 10 0, 0 0),
(5 5, 5 0, 10 5, 5 5))
false
A - touching holes do NOT disconnect (isCCW bug)
POLYGON ((60 40, 60 240, 460 240, 460 40, 60 40),
(260 200, 340 60, 400 120, 260 200),
(260 200, 120 100, 200 60, 260 200))
true
mA - adjacent shells (shared vertices)
MULTIPOLYGON (((40 120, 140 120, 140 40, 40 40, 40 120)),
((140 120, 40 120, 40 200, 140 200, 140 120)))
false
mA - adjacent shells (different vertices)
MULTIPOLYGON (((40 120, 140 120, 140 40, 40 40, 40 120)),
((160 120, 60 120, 40 200, 140 200, 160 120)))
false
mA - nested overlapping shells
MULTIPOLYGON (((80 260, 240 260, 240 100, 80 100, 80 260)),
((120 240, 220 240, 220 140, 120 140, 120 240)))
false
mA - nested non-overlapping shells
MULTIPOLYGON (((60 320, 60 80, 300 80, 60 320),
(80 280, 80 100, 260 100, 80 280)),
((120 160, 140 160, 140 140, 120 160)))
true
mA - nested non-overlapping shells, all vertices touch
MULTIPOLYGON (((20 380, 420 380, 420 20, 20 20, 20 380),
(220 340, 180 240, 60 200, 180 160, 340 60, 240 220, 220 340)),
((180 240, 180 160, 240 220, 180 240)))
true
mA - nested overlapping shells, all vertices touch
MULTIPOLYGON (((20 380, 420 380, 420 20, 20 20, 20 380),
(220 340, 180 240, 60 200, 140 100, 340 60, 300 240, 220 340)),
((60 200, 340 60, 220 340, 60 200)))
false
mA - nested non-overlapping shells, all vertices touch
MULTIPOLYGON (((20 380, 420 380, 420 20, 20 20, 20 380),
(220 340, 80 320, 60 200, 140 100, 340 60, 300 240, 220 340)),
((60 200, 340 60, 220 340, 60 200)))
true
mA - nested overlapping shells, all vertices touch
MULTIPOLYGON (((20 380, 420 380, 420 20, 20 20, 20 380),
(220 340, 180 240, 60 200, 200 180, 340 60, 240 220, 220 340)),
((60 200, 340 60, 220 340, 60 200)))
false
mA - disconnected exterior
MULTIPOLYGON (((100 20, 180 20, 180 100, 100 100, 100 20)),
((20 100, 100 100, 100 180, 20 180, 20 100)),
((100 180, 180 180, 180 260, 100 260, 100 180)),
((180 100, 260 100, 260 180, 180 180, 180 100)))
true
mA - shells touch in single point
MULTIPOLYGON (((110 110, 70 200, 150 200, 110 110)),
((110 110, 150 20, 70 20, 110 110)))
true
mA - duplicate shells
MULTIPOLYGON (((60 300, 320 220, 260 60, 60 100, 60 300)),
((60 300, 320 220, 260 60, 60 100, 60 300)))
false
mA - shells are not nested but share all vertices
MULTIPOLYGON (((180 60, 240 160, 300 60, 180 60)),
((80 80, 180 60, 160 140, 240 160, 360 140, 300 60, 420 100, 320 280, 120 260, 80 80)))
true
mA - shell is nested inside first hole
MULTIPOLYGON (((0 0, 0 8, 8 8, 8 0, 0 0),
(3 3, 7 3, 7 7, 3 7, 3 3),
(1 1, 2 1, 2 2, 1 2, 1 1)),
((4 4, 4 6, 6 6, 6 4, 4 4)))
true