Skip to content

Commit c3f4f3b

Browse files
committed
Lay out all points in array for polygon
1 parent f78d91f commit c3f4f3b

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/interfaces.jl

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -116,11 +116,15 @@ function decompose(::Type{P}, pol::Polygon) where {P<:AbstractPoint}
116116
if isempty(pol.interiors)
117117
return decompose(P, pol.exterior)
118118
else
119-
points = Array{Union{Point, Array}}[]
120-
push!(points, decompose(P, pol.exterior), [decompose(P, pol.interiors[1]) for i in pol.interiors])
121-
return points
119+
arr = P[]
120+
push!(arr, decompose(P, pol.exterior)...)
121+
for i in pol.interiors
122+
push!(arr, decompose(P, i)...)
123+
end
124+
return arr
122125
end
123126
end
127+
124128
decompose(::Type{P}, ls::LineString) where {P<:AbstractPoint} = ls.points.parent.data
125129
decompose_uv(primitive) = decompose(UV(), primitive)
126130
decompose_uvw(primitive) = decompose(UVW(), primitive)

0 commit comments

Comments
 (0)