|
1 | | - |
| 1 | +using GeoInterface |
| 2 | +using Test |
2 | 3 |
|
3 | 4 | @testset "Developer" begin |
4 | 5 | # Implement interface |
|
19 | 20 | GeoInterface.geomtype(::MyCurve) = GeoInterface.LineStringTrait() |
20 | 21 | GeoInterface.ngeom(::GeoInterface.LineStringTrait, geom::MyCurve) = 2 |
21 | 22 | GeoInterface.getgeom(::GeoInterface.LineStringTrait, geom::MyCurve, i) = MyPoint() |
22 | | - GeoInterface.convert(::Type{MyCurve}, ::GeoInterface.LineStringTrait, geom) = geom |
| 23 | + convert(::Type{MyCurve}, ::GeoInterface.LineStringTrait, geom) = geom |
23 | 24 |
|
24 | 25 | GeoInterface.isgeometry(::MyPolygon) = true |
25 | 26 | GeoInterface.geomtype(::MyPolygon) = GeoInterface.PolygonTrait() |
|
29 | 30 |
|
30 | 31 | @testset "Point" begin |
31 | 32 | geom = MyPoint() |
32 | | - @test GeoInterface.testgeometry(geom) |
| 33 | + @test testgeometry(geom) |
33 | 34 | @test GeoInterface.x(geom) === 1 |
34 | 35 | @test GeoInterface.y(geom) === 2 |
35 | | - @test GeoInterface.ncoord(geom) === 2 |
| 36 | + @test ncoord(geom) === 2 |
36 | 37 | end |
37 | 38 |
|
38 | 39 | @testset "LineString" begin |
39 | 40 | geom = MyCurve() |
40 | | - @test GeoInterface.testgeometry(geom) |
| 41 | + @test testgeometry(geom) |
41 | 42 | @test !isnothing(GeoInterface.convert(MyCurve, geom)) |
42 | 43 |
|
43 | 44 | @test GeoInterface.npoint(geom) == 2 # defaults to ngeom |
|
49 | 50 |
|
50 | 51 | @testset "Polygon" begin |
51 | 52 | geom = MyPolygon() |
52 | | - @test GeoInterface.testgeometry(geom) |
| 53 | + @test testgeometry(geom) |
53 | 54 |
|
54 | 55 | @test GeoInterface.nring(geom) == 2 |
55 | 56 | @test GeoInterface.nhole(geom) == 1 |
|
71 | 72 | struct Row end |
72 | 73 | struct Point end |
73 | 74 |
|
74 | | - GeoInterface.isgeometry(::Point) = true |
75 | | - GeoInterface.geomtype(::Point) = GeoInterface.PointTrait() |
76 | | - GeoInterface.ncoord(::GeoInterface.PointTrait, geom::Point) = 2 |
77 | | - GeoInterface.getcoord(::GeoInterface.PointTrait, geom::Point, i) = [1, 2][i] |
| 75 | + isgeometry(::Point) = true |
| 76 | + geomtype(::Point) = GeoInterface.PointTrait() |
| 77 | + ncoord(::GeoInterface.PointTrait, geom::Point) = 2 |
| 78 | + getcoord(::GeoInterface.PointTrait, geom::Point, i) = [1, 2][i] |
78 | 79 |
|
79 | 80 | GeoInterface.isfeature(::Row) = true |
80 | 81 | GeoInterface.geometry(r::Row) = Point() |
|
0 commit comments