@@ -56,7 +56,7 @@ using GeometryBasics: attributes
5656 end
5757
5858 end
59-
59+
6060 @testset " polygon with metadata" begin
6161 polys = [Polygon (rand (Point{2 , Float32}, 20 )) for i in 1 : 10 ]
6262 pnames = [randstring (4 ) for i in 1 : 10 ]
@@ -68,7 +68,7 @@ using GeometryBasics: attributes
6868 multipoly = MultiPolygonMeta (polys, name = pnames, value = numbers, category = bin)
6969 @test multipoly isa AbstractVector
7070 @test poly isa GeometryBasics. AbstractPolygon
71-
71+
7272 @test GeometryBasics. getcolumn (poly, :name ) == pnames[1 ]
7373 @test GeometryBasics. MetaFree (PolygonMeta) == Polygon
7474
@@ -92,7 +92,7 @@ using GeometryBasics: attributes
9292 @test metafree (pm) === p
9393 @test propertynames (pm) == (:position , :a , :b )
9494 end
95-
95+
9696 @testset " MultiPoint with metadata" begin
9797 p = collect (Point {2, Float64} (x, x+ 1 ) for x in 1 : 5 )
9898 @test p isa AbstractVector
@@ -144,18 +144,18 @@ end
144144 multipoly = MetaT (multipol, name = pnames, value = numbers, category = bin)
145145 @test multipoly isa MetaT
146146 @test poly isa MetaT
147-
147+
148148 @test GeometryBasics. getcolumn (poly, :name ) == pnames[1 ]
149149 @test GeometryBasics. getcolumn (multipoly, :name ) == pnames
150-
150+
151151 meta_p = MetaT (polys[1 ], boundingbox= Rect (0 , 0 , 2 , 2 ))
152152 @test meta_p. boundingbox === Rect (0 , 0 , 2 , 2 )
153153 @test GeometryBasics. metafree (meta_p) == polys[1 ]
154154 @test GeometryBasics. metafree (poly) == polys[1 ]
155155 @test GeometryBasics. metafree (multipoly) == multipol
156156 @test GeometryBasics. meta (meta_p) == (boundingbox = GeometryBasics. HyperRectangle {2,Int64} ([0 , 0 ], [2 , 2 ]),)
157157 @test GeometryBasics. meta (poly) == (name = pnames[1 ], value = 0.0 , category = bin[1 ])
158- @test GeometryBasics. meta (multipoly) == (name = pnames, value = numbers, category = bin)
158+ @test GeometryBasics. meta (multipoly) == (name = pnames, value = numbers, category = bin)
159159 end
160160
161161 @testset " MetaT{Point}" begin
171171 @test GeometryBasics. metafree (pm) == p
172172 @test GeometryBasics. meta (pm) == (a = 1 , b = 2 )
173173 end
174-
174+
175175 @testset " MetaT{MultiPoint}" begin
176176 p = collect (Point {2, Float64} (x, x+ 1 ) for x in 1 : 5 )
177177 @test p isa AbstractVector
623623
624624@testset " MetaT and heterogeneous data" begin
625625 ls = [LineString ([Point (i, (i+ 1 )^ 2 / 6 ), Point (i* 0.86 ,i+ 5 ), Point (i/ 3 , i/ 7 )]) for i in 1 : 10 ]
626- mls = MultiLineString ([LineString ([Point (i+ 1 , (i)^ 2 / 6 ), Point (i* 0.75 ,i+ 8 ), Point (i/ 2.5 , i/ 6.79 )]) for i in 5 : 10 ])
626+ mls = MultiLineString ([LineString ([Point (i+ 1 , (i)^ 2 / 6 ), Point (i* 0.75 ,i+ 8 ), Point (i/ 2.5 , i/ 6.79 )]) for i in 5 : 10 ])
627627 poly = Polygon (Point{2 , Int}[(40 , 40 ), (20 , 45 ), (45 , 30 ), (40 , 40 )])
628628 geom = [ls... , mls, poly]
629629 prop = Any[(country_states = " India$(i) " , rainfall = (i* 9 )/ 2 ) for i in 1 : 11 ]
@@ -637,17 +637,14 @@ end
637637 @test propertynames (sa) === (:main , :country_states , :rainfall )
638638 @test getproperty (sa, :country_states ) isa Array{Any}
639639 @test getproperty (sa, :main ) == geom
640-
641- @test GeometryBasics. getnamestypes (typeof (feat[1 ])) ==
640+
641+ @test GeometryBasics. getnamestypes (typeof (feat[1 ])) ==
642642 (LineString{2 ,Float64,Point{2 ,Float64},Base. ReinterpretArray{GeometryBasics. Ngon{2 ,Float64,2 ,Point{2 ,Float64}},1 ,Tuple{Point{2 ,Float64},Point{2 ,Float64}},TupleView{Tuple{Point{2 ,Float64},Point{2 ,Float64}},2 ,1 ,Array{Point{2 ,Float64},1 }}}},
643643 (:country_states , :rainfall ), Tuple{String,Float64})
644-
645- @test StructArrays. staticschema (typeof (feat[1 ])) ==
646- NamedTuple{(:main , :country_states , :rainfall ),Tuple{LineString{2 ,Float64,Point{2 ,Float64},Base. ReinterpretArray{GeometryBasics. Ngon{2 ,Float64,2 ,Point{2 ,Float64}},1 ,Tuple{Point{2 ,Float64},Point{2 ,Float64}},TupleView{Tuple{Point{2 ,Float64},Point{2 ,Float64}},2 ,1 ,Array{Point{2 ,Float64},1 }}}},
647- String,Float64}}
644+
648645
649646 @test StructArrays. createinstance (typeof (feat[1 ]), LineString ([Point (1 , (2 )^ 2 / 6 ), Point (1 * 0.86 ,6 ), Point (1 / 3 , 1 / 7 )]), " Mumbai" , 100 ) isa typeof (feat[1 ])
650-
647+
651648 @test Base. getindex (feat[1 ], 1 ) isa Line
652649 @test Base. size (feat[1 ]) == (2 ,)
653650end
0 commit comments