Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/wrappers.jl
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,10 @@ convert(::Type{Point}, ::PointTrait, geom) = Point(geom)
convert(::Type{Point}, ::PointTrait, geom::Point) = geom
extent(trait::PointTrait, geom::Point) = extent(trait, parent(geom))

ngeom(::PointTrait, geom::Point) = 0
getgeom(::PointTrait, geom::Point) = nothing
getgeom(::PointTrait, geom::Point, i) = nothing
Comment on lines +321 to +323
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
ngeom(::PointTrait, geom::Point) = 0
getgeom(::PointTrait, geom::Point) = nothing
getgeom(::PointTrait, geom::Point, i) = nothing
ngeom(::PointTrait, geom::Point) = error("`GI.ngeom` on a Point is not allowed! To get the number of dimensions use `GI.ncoord` instead.")
getgeom(::PointTrait, geom::Point) = error("`GI.getgeom` on a Point is not allowed! To get the number of dimensions use `GI.getcoord` instead, or `GI.x, GI.y, GI.z, GI.t`")
getgeom(::PointTrait, geom::Point, i) = error("`GI.getgeom` on a Point is not allowed! To get the number of dimensions use `GI.getcoord` instead, or `GI.x, GI.y, GI.z, GI.t`")


x(trait::PointTrait, geom::Point) = x(trait, parent(geom))
y(trait::PointTrait, geom::Point) = y(trait, parent(geom))
z(trait::PointTrait, geom::Point{true}) = z(trait, parent(geom))
Expand Down