-
-
Notifications
You must be signed in to change notification settings - Fork 56
Open
Description
In v0.5,
using GeometryBasics
points = rand(Point2f, 10)
LineString(view(points, 1:5))
errors with:
ERROR: MethodError: no method matching LineString(::SubArray{Point{2, Float32}, 1, Vector{Point{2, Float32}}, Tuple{UnitRange{Int64}}, true})
The type `LineString` exists, but no method is defined for this combination of argument types when trying to construct it.
Closest candidates are:
LineString(::Array{Point{Dim, T}, 1}) where {Dim, T<:Real}
@ GeometryBasics ~/.julia/dev/GeometryBasics/src/basic_types.jl:347
Stacktrace:
[1] top-level scope
@ REPL[50]:1
It looks like the array type in LineString is now restrictive. Should we allow any abstract vector in there, and add an extra type parameter? Or is there some other way this should be done?
I ask because it's pretty hard to minimize allocations with this approach. If the issue is purely in the type printing, then it's easy enough to fix that to not show the last type parameter (the array type).
rafaqz
Metadata
Metadata
Assignees
Labels
No labels