@@ -19,6 +19,8 @@ GeoInterface.geomtrait(::MultiPolygon) = MultiPolygonTrait()
1919GeoInterface. geomtrait (:: GeometryCollection ) = GeometryCollectionTrait ()
2020GeoInterface. geomtrait (geom:: PreparedGeometry ) = GeoInterface. geomtrait (geom. ownedby)
2121
22+ GeoInterface. isempty (:: AbstractGeometryTrait , geom:: AbstractGeometry ) = isEmpty (geom)
23+
2224GeoInterface. ngeom (:: AbstractGeometryCollectionTrait , geom:: AbstractMultiGeometry ) =
2325 isEmpty (geom) ? 0 : Int (numGeometries (geom))
2426GeoInterface. ngeom (:: LineStringTrait , geom:: LineString ) = Int (numPoints (geom))
@@ -45,7 +47,7 @@ GeoInterface.getgeom(
4547 :: Union{LineStringTrait,LinearRingTrait} ,
4648 geom:: Union{LineString,LinearRing} ,
4749 i,
48- ) = Point ( getPoint (geom, i) )
50+ ) = getPoint (geom, i)
4951GeoInterface. getgeom (t:: AbstractPointTrait , geom:: PreparedGeometry ) = nothing
5052function GeoInterface. getgeom (:: PolygonTrait , geom:: Polygon , i:: Int )
5153 if i == 1
@@ -70,11 +72,15 @@ GeoInterface.ncoord(::AbstractGeometryTrait, geom::AbstractGeometry) =
7072GeoInterface. ncoord (t:: AbstractGeometryTrait , geom:: PreparedGeometry ) =
7173 GeoInterface. ncoord (t, geom. ownedby)
7274
73- GeoInterface. getcoord (:: AbstractGeometryTrait , geom:: AbstractGeometry , i) =
75+ GeoInterface. getcoord (:: AbstractPointTrait , geom:: Point , i) =
7476 getCoordinates (getCoordSeq (geom), 1 )[i]
75- GeoInterface. getcoord (t:: AbstractGeometryTrait , geom:: PreparedGeometry , i) =
77+ GeoInterface. getcoord (t:: AbstractPointTrait , geom:: PreparedGeometry , i) =
7678 GeoInterface. getcoord (t, geom. ownedby, i)
7779
80+ GeoInterface. x (:: AbstractPointTrait , point:: AbstractGeometry ) = getGeomX (point)
81+ GeoInterface. y (:: AbstractPointTrait , point:: AbstractGeometry ) = getGeomY (point)
82+ GeoInterface. z (:: AbstractPointTrait , point:: AbstractGeometry ) = getGeomZ (point)
83+
7884# FIXME this doesn't work for 3d geoms, Z is missing
7985function GeoInterface. extent (:: AbstractGeometryTrait , geom:: AbstractGeometry )
8086 # minx, miny, maxx, maxy = getExtent(geom)
0 commit comments