Skip to content

Commit 1351bce

Browse files
asinghvi17claude
andcommitted
Add LineString constructor for AbstractVector
Fixes GI.convert failing when geometry is backed by StaticArrays. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 9918b18 commit 1351bce

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

src/basic_types.jl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -303,6 +303,11 @@ A LineString is a collection of points connected by line segments.
303303
struct LineString{Dim, T<:Real} <: AbstractGeometry{Dim, T}
304304
points::Vector{Point{Dim, T}}
305305
end
306+
307+
function LineString(points::AbstractVector{Point{Dim, T}}) where {Dim, T}
308+
return LineString{Dim,T}(convert(Vector{Point{Dim, T}}, points))
309+
end
310+
306311
Base.length(ls::LineString) = length(coordinates(ls))
307312
Base.:(==)(a::LineString, b::LineString) = a.points == b.points
308313
coordinates(ls::LineString) = ls.points

0 commit comments

Comments
 (0)