@@ -8,6 +8,11 @@ geointerface_geomtype(::LinearRingTrait) = LinearRing
88geointerface_geomtype (:: PolygonTrait ) = Polygon
99geointerface_geomtype (:: MultiPolygonTrait ) = MultiPolygon
1010geointerface_geomtype (:: GeometryCollectionTrait ) = GeometryCollection
11+ geointerface_geomtype (:: CircularStringTrait ) = CircularString
12+ geointerface_geomtype (:: CompoundCurveTrait ) = CompoundCurve
13+ geointerface_geomtype (:: CurvePolygonTrait ) = CurvePolygon
14+ geointerface_geomtype (:: MultiSurfaceTrait ) = MultiSurface
15+ geointerface_geomtype (:: MultiCurveTrait ) = MultiCurve
1116
1217GeoInterface. geomtrait (:: Point ) = PointTrait ()
1318GeoInterface. geomtrait (:: MultiPoint ) = MultiPointTrait ()
@@ -17,23 +22,33 @@ GeoInterface.geomtrait(::LinearRing) = LinearRingTrait()
1722GeoInterface. geomtrait (:: Polygon ) = PolygonTrait ()
1823GeoInterface. geomtrait (:: MultiPolygon ) = MultiPolygonTrait ()
1924GeoInterface. geomtrait (:: GeometryCollection ) = GeometryCollectionTrait ()
25+ GeoInterface. geomtrait (:: CircularString ) = CircularStringTrait ()
26+ GeoInterface. geomtrait (:: CompoundCurve ) = CompoundCurveTrait ()
27+ GeoInterface. geomtrait (:: CurvePolygon ) = CurvePolygonTrait ()
28+ GeoInterface. geomtrait (:: MultiSurface ) = MultiSurfaceTrait ()
29+ GeoInterface. geomtrait (:: MultiCurve ) = MultiCurveTrait ()
2030GeoInterface. geomtrait (geom:: PreparedGeometry ) = GeoInterface. geomtrait (geom. ownedby)
2131
2232GeoInterface. isempty (:: AbstractGeometryTrait , geom:: AbstractGeometry ) = isEmpty (geom)
2333
2434GeoInterface. ngeom (:: AbstractGeometryCollectionTrait , geom:: AbstractMultiGeometry ) =
2535 isEmpty (geom) ? 0 : Int (numGeometries (geom))
2636GeoInterface. ngeom (:: LineStringTrait , geom:: LineString ) = Int (numPoints (geom))
37+ GeoInterface. ngeom (:: CircularStringTrait , geom:: CircularString ) = Int (numPoints (geom))
2738GeoInterface. ngeom (:: LinearRingTrait , geom:: LinearRing ) = Int (numPoints (geom))
2839GeoInterface. ngeom (:: PolygonTrait , geom:: Polygon ) = Int (numInteriorRings (geom)) + 1
40+ GeoInterface. ngeom (:: CurvePolygonTrait , geom:: CurvePolygon ) =
41+ Int (numInteriorRings (geom)) + 1
2942GeoInterface. ngeom (t:: AbstractGeometryTrait , geom:: PreparedGeometry ) =
3043 GeoInterface. ngeom (t, geom. ownedby)
3144GeoInterface. ngeom (:: AbstractPointTrait , geom:: Point ) = 0
3245GeoInterface. ngeom (:: AbstractPointTrait , geom:: PreparedGeometry ) = 0
3346
3447GI. is3d (:: AbstractGeometryTrait , geom:: AbstractGeometry ) = hasZ (geom)
35- GI. getexterior (:: AbstractPolygonTrait , geom:: Polygon ) = exteriorRing (geom)
36- GI. gethole (:: AbstractPolygonTrait , geom:: Polygon , n) = interiorRing (geom, n)
48+ GI. getexterior (:: AbstractPolygonTrait , geom:: Union{Polygon,CurvePolygon} ) =
49+ exteriorRing (geom)
50+ GI. gethole (:: AbstractPolygonTrait , geom:: Union{Polygon,CurvePolygon} , n) =
51+ interiorRing (geom, n)
3752
3853function GeoInterface. getgeom (
3954 :: AbstractGeometryCollectionTrait ,
@@ -60,6 +75,13 @@ function GeoInterface.getgeom(::PolygonTrait, geom::Polygon, i::Int)
6075 interiorRing (geom, i - 1 )
6176 end
6277end
78+ function GeoInterface. getgeom (:: CurvePolygonTrait , geom:: CurvePolygon , i:: Int )
79+ if i == 1
80+ exteriorRing (geom)
81+ else
82+ interiorRing (geom, i - 1 )
83+ end
84+ end
6385GeoInterface. getgeom (t:: AbstractGeometryTrait , geom:: PreparedGeometry , i) =
6486 GeoInterface. getgeom (t, geom. ownedby, i)
6587GeoInterface. getgeom (t:: AbstractPointTrait , geom:: PreparedGeometry , i) = 0
0 commit comments