@@ -8,6 +8,7 @@ abstract type MyAbstractGeom{N} end
88# Implement interface
99struct MyPoint{N} <: MyAbstractGeom{N} end
1010struct MyCurve{N} <: MyAbstractGeom{N} end
11+ struct MyLinearRing{N} <: MyAbstractGeom{N} end
1112struct MyPolygon{N} <: MyAbstractGeom{N} end
1213struct MyMultiPoint{N} <: MyAbstractGeom{N} end
1314struct MyMultiCurve{N} <: MyAbstractGeom{N} end
@@ -31,6 +32,11 @@ GeoInterface.ngeom(::GeoInterface.LineStringTrait, geom::MyCurve) = 3
3132GeoInterface. getgeom (:: GeoInterface.LineStringTrait , geom:: MyCurve{N} , i) where {N} = MyPoint {N} ()
3233GeoInterface. convert (:: Type{MyCurve} , :: GeoInterface.LineStringTrait , geom) = geom
3334
35+ GeoInterface. geomtrait (:: MyLinearRing ) = GeoInterface. LinearRingTrait ()
36+ GeoInterface. ngeom (:: GeoInterface.LinearRingTrait , geom:: MyLinearRing ) = 3
37+ GeoInterface. getgeom (:: GeoInterface.LinearRingTrait , geom:: MyLinearRing{N} , i) where {N} = MyPoint {N} ()
38+ GeoInterface. convert (:: Type{MyLinearRing} , :: GeoInterface.LinearRingTrait , geom) = geom
39+
3440GeoInterface. geomtrait (:: MyPolygon ) = GeoInterface. PolygonTrait ()
3541GeoInterface. ngeom (:: GeoInterface.PolygonTrait , geom:: MyPolygon ) = 2
3642GeoInterface. getgeom (:: GeoInterface.PolygonTrait , geom:: MyPolygon{N} , i) where {N} = MyCurve {N} ()
@@ -53,13 +59,15 @@ GeoInterface.getgeom(::GeoInterface.GeometryCollectionTrait, geom::MyCollection{
5359 # 2d
5460 plot (MyPoint {2} ())
5561 plot (MyCurve {2} ())
62+ plot (MyLinearRing {2} ())
5663 plot (MyMultiPoint {2} ())
5764 plot (MyPolygon {2} ())
5865 plot (MyMultiPolygon {2} ())
5966 plot (MyCollection {2} ())
6067 # 3d
6168 plot (MyPoint {3} ())
6269 plot (MyCurve {3} ())
70+ plot (MyLinearRing {3} ())
6371 plot (MyMultiPoint {3} ())
6472 plot (MyPolygon {3} ())
6573 plot (MyMultiPolygon {3} ())
0 commit comments