1- facts ( " Geo interface" ) do
1+ @testset " Geo interface" begin
22 pt = LibGEOS. Point (1.0 ,2.0 )
3- @fact GeoInterface. coordinates (pt) --> roughly ( [1 ,2 ], 1e-5 )
4- @fact GeoInterface. geotype (pt) --> :Point
3+ @test GeoInterface. coordinates (pt) ≈ [1 ,2 ] atol = 1e-5
4+ @test GeoInterface. geotype (pt) == :Point
55
66 pt = LibGEOS. Point (1 , 2 )
7- @fact GeoInterface. coordinates (pt) --> roughly ( [1 ,2 ], 1e-5 )
8- @fact GeoInterface. geotype (pt) --> :Point
7+ @test GeoInterface. coordinates (pt) ≈ [1 ,2 ] atol = 1e-5
8+ @test GeoInterface. geotype (pt) == :Point
99
1010
1111 pt = LibGEOS. Point (LibGEOS. geomFromWKT (" POINT EMPTY" ))
12- @fact GeoInterface. coordinates (pt) --> roughly ( Float64[], 1e-5 )
13- @fact GeoInterface. geotype (pt) --> :Point
12+ @test GeoInterface. coordinates (pt) ≈ Float64[] atol = 1e-5
13+ @test GeoInterface. geotype (pt) == :Point
1414
1515 mpt = LibGEOS. MultiPoint (LibGEOS. geomFromWKT (" MULTIPOINT(0 0, 10 0, 10 10, 11 10)" ))
16- @fact GeoInterface. coordinates (mpt) --> Vector{Float64}[[0 ,0 ],[10 ,0 ],[10 ,10 ],[11 ,10 ]]
17- @fact GeoInterface. geotype (mpt) --> :MultiPoint
16+ @test GeoInterface. coordinates (mpt) == Vector{Float64}[[0 ,0 ],[10 ,0 ],[10 ,10 ],[11 ,10 ]]
17+ @test GeoInterface. geotype (mpt) == :MultiPoint
1818
1919 coords = Vector{Float64}[[8 ,1 ],[9 ,1 ],[9 ,2 ],[8 ,2 ]]
2020 ls = LibGEOS. LineString (coords)
21- @fact GeoInterface. coordinates (ls) --> coords
22- @fact GeoInterface. geotype (ls) --> :LineString
21+ @test GeoInterface. coordinates (ls) == coords
22+ @test GeoInterface. geotype (ls) == :LineString
2323
2424 ls = LibGEOS. LineString (LibGEOS. geomFromWKT (" LINESTRING EMPTY" ))
25- @fact GeoInterface. coordinates (ls) --> []
26- @fact GeoInterface. geotype (ls) --> :LineString
25+ @test GeoInterface. coordinates (ls) == []
26+ @test GeoInterface. geotype (ls) == :LineString
2727
2828 mls = LibGEOS. MultiLineString (LibGEOS. geomFromWKT (" MULTILINESTRING ((5 0, 10 0), (0 0, 5 0))" ))
29- @fact GeoInterface. coordinates (mls) --> [[[5 ,0 ],[10 ,0 ]],[[0 ,0 ],[5 ,0 ]]]
30- @fact GeoInterface. geotype (mls) --> :MultiLineString
29+ @test GeoInterface. coordinates (mls) == [[[5 ,0 ],[10 ,0 ]],[[0 ,0 ],[5 ,0 ]]]
30+ @test GeoInterface. geotype (mls) == :MultiLineString
3131
3232 coords = Vector{Float64}[[8 ,1 ],[9 ,1 ],[9 ,2 ],[8 ,2 ],[8 ,1 ]]
3333 lr = LibGEOS. LinearRing (coords)
34- @fact GeoInterface. coordinates (lr) --> coords
35- @fact GeoInterface. geotype (lr) --> :LineString
34+ @test GeoInterface. coordinates (lr) == coords
35+ @test GeoInterface. geotype (lr) == :LineString
3636
3737 coords = Vector{Vector{Float64}}[Vector{Float64}[[0 ,0 ],[10 ,0 ],[10 ,10 ],[0 ,10 ],[0 ,0 ]],
3838 Vector{Float64}[[1 ,8 ],[2 ,8 ],[2 ,9 ],[1 ,9 ],[1 ,8 ]],
3939 Vector{Float64}[[8 ,1 ],[9 ,1 ],[9 ,2 ],[8 ,2 ],[8 ,1 ]]]
4040 polygon = LibGEOS. Polygon (coords)
41- @fact GeoInterface. coordinates (polygon) --> coords
42- @fact GeoInterface. geotype (polygon) --> :Polygon
41+ @test GeoInterface. coordinates (polygon) == coords
42+ @test GeoInterface. geotype (polygon) == :Polygon
4343
4444 polygon = LibGEOS. Polygon (LibGEOS. geomFromWKT (" POLYGON EMPTY" ))
45- @fact GeoInterface. coordinates (polygon) --> [[]]
46- @fact GeoInterface. geotype (polygon) --> :Polygon
45+ @test GeoInterface. coordinates (polygon) == [[]]
46+ @test GeoInterface. geotype (polygon) == :Polygon
4747
4848 multipolygon = LibGEOS. MultiPolygon (LibGEOS. geomFromWKT (" MULTIPOLYGON(((0 0,0 10,10 10,10 0,0 0)))" ))
49- @fact GeoInterface. coordinates (multipolygon) --> Vector{Vector{Vector{Float64}}}[Vector{Vector{Float64}}[Vector{Float64}[[0 ,0 ],[0 ,10 ],[10 ,10 ],[10 ,0 ],[0 ,0 ]]]]
50- @fact GeoInterface. geotype (multipolygon) --> :MultiPolygon
49+ @test GeoInterface. coordinates (multipolygon) == Vector{Vector{Vector{Float64}}}[Vector{Vector{Float64}}[Vector{Float64}[[0 ,0 ],[0 ,10 ],[10 ,10 ],[10 ,0 ],[0 ,0 ]]]]
50+ @test GeoInterface. geotype (multipolygon) == :MultiPolygon
5151
5252 geomcollection = LibGEOS. GeometryCollection (LibGEOS. geomFromWKT (" 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)), 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)), 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)))" ))
5353 collection = GeoInterface. geometries (geomcollection)
@@ -61,8 +61,8 @@ facts("Geo interface") do
6161 Vector{Vector{Float64}}[Vector{Float64}[[0.5 ,9.0 ],[ 3.0 , 8.0 ],[2.0 ,2.0 ],[0.5 ,9.0 ]]],
6262 Vector{Vector{Float64}}[Vector{Float64}[[0.0 ,0.0 ],[ 2.0 , 2.0 ],[8.5 ,1.0 ],[0.0 ,0.0 ]]],
6363 Vector{Vector{Float64}}[Vector{Float64}[[0.0 ,0.0 ],[ 0.5 , 9.0 ],[2.0 ,2.0 ],[0.0 ,0.0 ]]]]
64- @fact map (GeoInterface. coordinates,collection) --> coords
65- @fact GeoInterface. geotype (geomcollection) --> :GeometryCollection
64+ @test map (GeoInterface. coordinates,collection) == coords
65+ @test GeoInterface. geotype (geomcollection) == :GeometryCollection
6666
6767 geomcollection = LibGEOS. GeometryCollection (LibGEOS. geomFromWKT (" GEOMETRYCOLLECTION(MULTIPOINT(0 0, 0 0, 1 1),LINESTRING(1 1, 2 2, 2 2, 0 0),POLYGON((5 5, 0 0, 0 2, 2 2, 5 5)))" ))
6868 collection = GeoInterface. geometries (geomcollection)
@@ -71,13 +71,13 @@ facts("Geo interface") do
7171 Vector{Vector{Float64}}[Vector{Float64}[[5.0 ,5.0 ],[0.0 ,0.0 ],[0.0 ,2.0 ],[2.0 ,2.0 ],[5.0 ,5.0 ]]]]
7272 geotypes = [:MultiPoint ,:LineString ,:Polygon ]
7373 for (i,item) in enumerate (collection)
74- @fact GeoInterface. coordinates (item) --> coords[i]
75- @fact GeoInterface. geotype (item) --> geotypes[i]
74+ @test GeoInterface. coordinates (item) == coords[i]
75+ @test GeoInterface. geotype (item) == geotypes[i]
7676 end
77- @fact GeoInterface. geotype (geomcollection) --> :GeometryCollection
77+ @test GeoInterface. geotype (geomcollection) == :GeometryCollection
7878
7979 geomcollection = LibGEOS. GeometryCollection (LibGEOS. geomFromWKT (" GEOMETRYCOLLECTION EMPTY" ))
8080 collection = GeoInterface. geometries (geomcollection)
81- @fact length (collection) --> 0
82- @fact GeoInterface. geotype (geomcollection) --> :GeometryCollection
81+ @test length (collection) == 0
82+ @test GeoInterface. geotype (geomcollection) == :GeometryCollection
8383end
0 commit comments