@@ -269,7 +269,11 @@ def test_sym_difference
269
269
270
270
comparison_tester (
271
271
method ,
272
- 'MULTIPOINT (0 0, 1 0)' ,
272
+ if Geos ::GEOS_NICE_VERSION >= '031200'
273
+ 'MULTIPOINT ((0 0), (1 0))'
274
+ else
275
+ 'MULTIPOINT (0 0, 1 0)'
276
+ end ,
273
277
'POINT(0 0)' ,
274
278
'POINT(1 0)'
275
279
)
@@ -365,7 +369,11 @@ def test_boundary
365
369
366
370
simple_tester (
367
371
:boundary ,
368
- 'MULTIPOINT (0 0, 10 10)' ,
372
+ if Geos ::GEOS_NICE_VERSION >= '031200'
373
+ 'MULTIPOINT ((0 0), (10 10))'
374
+ else
375
+ 'MULTIPOINT (0 0, 10 10)'
376
+ end ,
369
377
'LINESTRING(0 0, 10 10)'
370
378
)
371
379
@@ -386,7 +394,11 @@ def test_union
386
394
387
395
comparison_tester (
388
396
:union ,
389
- 'MULTIPOINT (0 0, 1 0)' ,
397
+ if Geos ::GEOS_NICE_VERSION >= '031200'
398
+ 'MULTIPOINT ((0 0), (1 0))'
399
+ else
400
+ 'MULTIPOINT (0 0, 1 0)'
401
+ end ,
390
402
'POINT(0 0)' ,
391
403
'POINT(1 0)'
392
404
)
@@ -468,7 +480,14 @@ def test_union_with_precision
468
480
469
481
result = geom_a . union ( geom_b , precision : 2 )
470
482
471
- assert_equal ( 'MULTIPOINT (2 8, 4 10)' , write ( result ) )
483
+ assert_equal (
484
+ if Geos ::GEOS_NICE_VERSION >= '031200'
485
+ 'MULTIPOINT ((2 8), (4 10))'
486
+ else
487
+ 'MULTIPOINT (2 8, 4 10)'
488
+ end ,
489
+ write ( result )
490
+ )
472
491
end
473
492
474
493
def test_union_cascaded
@@ -486,7 +505,7 @@ def test_union_cascaded
486
505
((10 10, 10 14, 14 14, 14 10, 10 10),
487
506
(11 11, 11 12, 12 12, 12 11, 11 11)),
488
507
((0 0, 11 0, 11 11, 0 11, 0 0))
489
- )) '
508
+ )'
490
509
)
491
510
end
492
511
@@ -503,7 +522,7 @@ def test_coverage_union
503
522
'MULTIPOLYGON(
504
523
((0 0, 0 1, 1 1, 1 0, 0 0)),
505
524
((1 0, 1 1, 2 1, 2 0, 1 0))
506
- )) '
525
+ )'
507
526
)
508
527
end
509
528
@@ -522,7 +541,7 @@ def test_unary_union
522
541
((10 10, 10 14, 14 14, 14 10, 10 10),
523
542
(11 11, 11 12, 12 12, 12 11, 11 11)),
524
543
((0 0, 11 0, 11 11, 0 11, 0 0))
525
- )) '
544
+ )'
526
545
)
527
546
end
528
547
@@ -537,7 +556,7 @@ def test_unary_union_with_precision
537
556
((10 10, 10 14, 14 14, 14 10, 10 10),
538
557
(11 11, 11 12, 12 12, 12 11, 11 11)),
539
558
((0 0, 11 0, 11 11, 0 11, 0 0))
540
- )) ' ,
559
+ )' ,
541
560
3
542
561
)
543
562
end
@@ -565,7 +584,7 @@ def test_union_without_arguments
565
584
((10 10, 10 14, 14 14, 14 10, 10 10),
566
585
(11 11, 11 12, 12 12, 12 11, 11 11)),
567
586
((0 0, 11 0, 11 11, 0 11, 0 0))
568
- )) '
587
+ )'
569
588
)
570
589
end
571
590
@@ -792,13 +811,17 @@ def test_extract_unique_points
792
811
LINESTRING (0 0, 2 3),
793
812
MULTIPOINT (0 0, 2 3),
794
813
POINT (9 0),
795
- POINT(1 0) ),
814
+ POINT (1 0),
796
815
LINESTRING EMPTY
797
- ' )
816
+ ) ' )
798
817
799
818
simple_tester (
800
819
:extract_unique_points ,
801
- 'MULTIPOINT (0 0, 1 0, 1 1, 0 1, 10 10, 10 14, 14 14, 14 10, 11 11, 11 12, 12 12, 12 11, 2 3, 3 4, 9 0)' ,
820
+ if Geos ::GEOS_NICE_VERSION >= '031200'
821
+ 'MULTIPOINT ((0 0), (1 0), (1 1), (0 1), (10 10), (10 14), (14 14), (14 10), (11 11), (11 12), (12 12), (12 11), (2 3), (3 4), (9 0))'
822
+ else
823
+ 'MULTIPOINT (0 0, 1 0, 1 1, 0 1, 10 10, 10 14, 14 14, 14 10, 11 11, 11 12, 12 12, 12 11, 2 3, 3 4, 9 0)'
824
+ end ,
802
825
geom . extract_unique_points
803
826
)
804
827
end
@@ -972,10 +995,10 @@ def test_valid_detail
972
995
973
996
tester [ 'Self-intersection' , 'POINT (2.5 5)' , 'POLYGON((0 0, 0 5, 5 5, 5 10, 0 0))' , 0 ]
974
997
975
- tester [ 'Ring Self-intersection' , 'POINT (0 0)' , 'POLYGON((0 0, -10 10, 10 10, 0 0, 4 5, -4 5, 0 0))) ' , 0 ]
998
+ tester [ 'Ring Self-intersection' , 'POINT (0 0)' , 'POLYGON((0 0, -10 10, 10 10, 0 0, 4 5, -4 5, 0 0))' , 0 ]
976
999
977
1000
assert_nil (
978
- read ( 'POLYGON((0 0, -10 10, 10 10, 0 0, 4 5, -4 5, 0 0))) ' ) . valid_detail (
1001
+ read ( 'POLYGON((0 0, -10 10, 10 10, 0 0, 4 5, -4 5, 0 0))' ) . valid_detail (
979
1002
:allow_selftouching_ring_forming_hole
980
1003
)
981
1004
)
@@ -1635,7 +1658,7 @@ def test_dup_srid
1635
1658
end
1636
1659
1637
1660
def test_line_string_enumerator
1638
- geom = read ( 'LINESTRING(0 0, 10 10)) ' )
1661
+ geom = read ( 'LINESTRING(0 0, 10 10)' )
1639
1662
assert_kind_of ( Enumerable , geom . each )
1640
1663
assert_kind_of ( Enumerable , geom . to_enum )
1641
1664
assert_equal ( geom , geom . each ( &EMPTY_BLOCK ) )
@@ -1827,13 +1850,13 @@ def test_delaunay_triangulation
1827
1850
'GEOMETRYCOLLECTION (POLYGON ((8 2, 10 10, 8.5 1, 8 2)), POLYGON ((7 8, 10 10, 8 2, 7 8)), POLYGON ((3 8, 10 10, 7 8, 3 8)), ' \
1828
1851
'POLYGON ((2 2, 8 2, 8.5 1, 2 2)), POLYGON ((2 2, 7 8, 8 2, 2 2)), POLYGON ((2 2, 3 8, 7 8, 2 2)), POLYGON ((0.5 9, 10 10, 3 8, 0.5 9)), ' \
1829
1852
'POLYGON ((0.5 9, 3 8, 2 2, 0.5 9)), POLYGON ((0 0, 2 2, 8.5 1, 0 0)), POLYGON ((0 0, 0.5 9, 2 2, 0 0)))' ,
1830
- 'POLYGON((0 0, 8.5 1, 10 10, 0.5 9, 0 0),(2 2, 3 8, 7 8, 8 2, 2 2))) ' ,
1853
+ 'POLYGON((0 0, 8.5 1, 10 10, 0.5 9, 0 0),(2 2, 3 8, 7 8, 8 2, 2 2))' ,
1831
1854
0
1832
1855
]
1833
1856
1834
1857
tester [
1835
1858
'MULTILINESTRING ((8.5 1, 10 10), (8 2, 10 10), (8 2, 8.5 1), (7 8, 10 10), (7 8, 8 2), (3 8, 10 10), (3 8, 7 8), (2 2, 8.5 1), (2 2, 8 2), (2 2, 7 8), (2 2, 3 8), (0.5 9, 10 10), (0.5 9, 3 8), (0.5 9, 2 2), (0 0, 8.5 1), (0 0, 2 2), (0 0, 0.5 9))' ,
1836
- 'POLYGON((0 0, 8.5 1, 10 10, 0.5 9, 0 0),(2 2, 3 8, 7 8, 8 2, 2 2))) ' ,
1859
+ 'POLYGON((0 0, 8.5 1, 10 10, 0.5 9, 0 0),(2 2, 3 8, 7 8, 8 2, 2 2))' ,
1837
1860
0 ,
1838
1861
only_edges : true
1839
1862
]
@@ -1945,7 +1968,14 @@ def test_minimum_rotated_rectangle
1945
1968
geom = read ( 'POLYGON ((1 6, 6 11, 11 6, 6 1, 1 6))' )
1946
1969
minimum_rotated_rectangle = geom . minimum_rotated_rectangle
1947
1970
1948
- assert_equal ( 'POLYGON ((6 1, 11 6, 6 11, 1 6, 6 1))' , write ( minimum_rotated_rectangle ) )
1971
+ assert_equal (
1972
+ if Geos ::GEOS_NICE_VERSION >= '031200'
1973
+ 'POLYGON ((6 1, 1 6, 6 11, 11 6, 6 1))'
1974
+ else
1975
+ 'POLYGON ((6 1, 11 6, 6 11, 1 6, 6 1))'
1976
+ end ,
1977
+ write ( minimum_rotated_rectangle )
1978
+ )
1949
1979
end
1950
1980
1951
1981
def test_minimum_clearance
@@ -2078,7 +2108,13 @@ def test_reverse
2078
2108
skip unless ENV [ 'FORCE_TESTS' ] || Geos ::Geometry . method_defined? ( :reverse )
2079
2109
2080
2110
simple_tester ( :reverse , 'POINT (3 5)' , 'POINT (3 5)' )
2081
- simple_tester ( :reverse , 'MULTIPOINT (100 100, 10 100, 30 100)' , 'MULTIPOINT (100 100, 10 100, 30 100)' )
2111
+
2112
+ if Geos ::GEOS_NICE_VERSION >= '031200'
2113
+ simple_tester ( :reverse , 'MULTIPOINT ((100 100), (10 100), (30 100))' , 'MULTIPOINT (100 100, 10 100, 30 100)' )
2114
+ else
2115
+ simple_tester ( :reverse , 'MULTIPOINT (100 100, 10 100, 30 100)' , 'MULTIPOINT (100 100, 10 100, 30 100)' )
2116
+ end
2117
+
2082
2118
simple_tester ( :reverse , 'LINESTRING (200 200, 200 100)' , 'LINESTRING (200 100, 200 200)' )
2083
2119
2084
2120
if Geos ::GEOS_NICE_VERSION >= '030801'
0 commit comments