|
1 | 1 | using Test |
2 | 2 | using LibGEOS |
3 | | -@testset "smoketests" begin |
4 | | - p = LibGEOS.createEmptyPolygon() |
5 | | - @test p == readgeom("POLYGON EMPTY") |
6 | | - @test p isa Polygon |
7 | | - |
8 | | - lss = readgeom("MULTILINESTRING((0 0, 0 1), (0 1, 0 2))") |
9 | | - @test lineMerge(lss) == readgeom("MULTILINESTRING ((0 0, 0 1, 0 2))") |
10 | | - |
11 | | - geo_invalid = readgeom("POLYGON((0 0, 0 1, 1 1, 1 0, -1 1, 0 0))") |
12 | | - @test !LibGEOS.isValid(geo_invalid) |
13 | | - geo_valid = LibGEOS.makeValid(geo_invalid) |
14 | | - @test geo_valid isa LibGEOS.MultiPolygon |
15 | | - @test LibGEOS.isValid(geo_valid) |
16 | | - |
17 | | - @test LibGEOS.reverse(readgeom("LINESTRING(0 0, 1 1)")) == readgeom("LINESTRING(1 1, 0 0)") |
18 | | - |
19 | | - |
20 | | -end |
21 | 3 |
|
22 | 4 | @testset "WKTWriter" begin |
23 | 5 | # default writing options |
|
917 | 899 | # LibGEOS.getExtent(geom) == [0, 0, 1, 1] |
918 | 900 | GeoInterface.extent(geom) == Extent(X = (0, 1), Y = (0, 1)) |
919 | 901 | end |
| 902 | + |
| 903 | + p = LibGEOS.createEmptyPolygon() |
| 904 | + @test p == readgeom("POLYGON EMPTY") |
| 905 | + @test p isa Polygon |
| 906 | + |
| 907 | + lss = readgeom("MULTILINESTRING((0 0, 0 1), (0 1, 0 2))") |
| 908 | + @test lineMerge(lss) == readgeom("MULTILINESTRING ((0 0, 0 1, 0 2))") |
| 909 | + |
| 910 | + geo_invalid = readgeom("POLYGON((0 0, 0 1, 1 1, 1 0, -1 1, 0 0))") |
| 911 | + @test !LibGEOS.isValid(geo_invalid) |
| 912 | + geo_valid = LibGEOS.makeValid(geo_invalid) |
| 913 | + @test geo_valid isa LibGEOS.MultiPolygon |
| 914 | + @test LibGEOS.isValid(geo_valid) |
| 915 | + |
| 916 | + @test LibGEOS.reverse(readgeom("LINESTRING(0 0, 1 1)")) == readgeom("LINESTRING(1 1, 0 0)") |
920 | 917 | end |
0 commit comments