Skip to content

Commit 9953e41

Browse files
committed
Overload decompose
1 parent 6fb0e70 commit 9953e41

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

src/geometry_primitives.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,10 @@ function convert_simplex(::Type{Point{N, T}}, x) where {N, T}
5656
N2 = length(x)
5757
return (Point{N, T}(ntuple(i-> i <= N2 ? T(x[i]) : T(0), N)),)
5858
end
59-
function convert_simplex(::Type{Point{N, T}}, x::Line) where {N, T}
60-
N2 = length(x)
61-
return (Point{N, T}[x[1], x[2]])
62-
end
59+
# function convert_simplex(::Type{Point{N, T}}, x::Line) where {N, T}
60+
# N2 = length(x)
61+
# return (Point{N, T}[x[1])
62+
# end
6363

6464
function convert_simplex(::Type{Vec{N, T}}, x) where {N, T}
6565
N2 = length(x)

src/interfaces.jl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,10 @@ end
111111
function decompose(::Type{T}, primitive) where {T}
112112
return collect_with_eltype(T, primitive)
113113
end
114+
"""
115+
decompose a linesting into points
116+
"""
117+
decompose(::Type{P}, ls::LineString) where {P<:AbstractPoint} = ls.points.parent.data
114118

115119
decompose_uv(primitive) = decompose(UV(), primitive)
116120
decompose_uvw(primitive) = decompose(UVW(), primitive)

0 commit comments

Comments
 (0)