@@ -2,32 +2,38 @@ import GeoInterface as GI
22
33GeoInterface. isgeometry (:: Type{<:Point} ) = true
44GeoInterface. geomtrait (:: Point ) = PointTrait ()
5- # GeoInterface.trait(::Point) = FeatureTrait()
5+ GeoInterface. trait (:: Point ) = FeatureTrait ()
66
77GeoInterface. ncoord (:: PointTrait , p:: Point ) = 3
8- GeoInterface. getcoord (:: PointTrait , p:: Point ) = [p . x, p . y, p . z]
9- GeoInterface. getcoord (:: PointTrait , p:: Point , i) = getfield (p, i)
8+ GeoInterface. getcoord (:: PointTrait , p:: Point ) = p . geometry
9+ GeoInterface. getcoord (:: PointTrait , p:: Point , i) = p . geometry[i]
1010
11- GeoInterface. x (:: PointTrait , p:: Point ) = p. x
12- GeoInterface. y (:: PointTrait , p:: Point ) = p. y
13- GeoInterface. z (:: PointTrait , p:: Point ) = p. z
11+ GeoInterface. x (:: PointTrait , p:: Point ) = p. geometry[ 1 ]
12+ GeoInterface. y (:: PointTrait , p:: Point ) = p. geometry[ 2 ]
13+ GeoInterface. z (:: PointTrait , p:: Point ) = p. geometry[ 3 ]
1414
1515GeoInterface. isfeature (feat:: Type{<:Point} ) = true
1616GeoInterface. properties (feat:: T ) where {T<: Point } = NamedTuple (zip (fieldnames (T), getfield (feat, n) for n in fieldnames (T)))
17- GeoInterface. geometry (feat:: Point ) = feat
17+ GeoInterface. geometry (feat:: Point ) = feat. geom
1818
1919GeoInterface. isgeometry (:: Type{<:Dataset} ) = true
2020GeoInterface. geomtrait (:: Dataset ) = MultiPointTrait ()
21- # GeoInterface.trait(::Dataset) = FeatureCollectionTrait()
21+ GeoInterface. trait (:: Dataset ) = FeatureCollectionTrait ()
2222GeoInterface. ngeom (:: MultiPointTrait , ds:: Dataset ) = length (ds)
2323GeoInterface. getgeom (:: MultiPointTrait , ds:: Dataset ) = ds
2424GeoInterface. getgeom (:: MultiPointTrait , ds:: Dataset , i) = ds[i]
2525
26- # GeoInterface.crs(geomtrait(geom), geom::customgeom)::GeoFormatTypes.GeoFormat}
26+ # GeoInterface.crs(geomtrait(geom), geom::customgeom)::GeoFormatTypes.GeoFormat
2727GeoInterface. extent (:: MultiPointTrait , ds:: Dataset ) = Extent (X= (ds. header. min_x, ds. header. max_x), Y= (ds. header. min_y, ds. header. max_y), Z= (ds. header. min_z, ds. header. max_z))
2828
2929GeoInterface. isfeaturecollection (:: Type{Dataset} ) = true
3030GeoInterface. getfeature (:: MultiPointTrait , ds:: Dataset , i) = ds[i]
3131GeoInterface. getfeature (:: MultiPointTrait , ds:: Dataset ) = ds
3232GeoInterface. nfeature (:: MultiPointTrait , ds:: Dataset ) = length (ds)
33- GeoInterface. geometrycolumns (:: Dataset ) = ()
33+ GeoInterface. geometrycolumns (:: Dataset ) = (:geometry ,)
34+
35+ GeoInterface. isgeometry (:: Type{<:AbstractVector{<:Point}} ) = true
36+ GeoInterface. geomtrait (:: AbstractVector{<:Point} ) = MultiPointTrait ()
37+ GeoInterface. ngeom (:: MultiPointTrait , ds:: AbstractVector{<:Point} ) = length (ds)
38+ GeoInterface. getgeom (:: MultiPointTrait , ds:: AbstractVector{<:Point} ) = ds
39+ GeoInterface. getgeom (:: MultiPointTrait , ds:: AbstractVector{<:Point} , i) = ds[i]
0 commit comments