Skip to content

Commit dea7093

Browse files
committed
Eagerly compute extents in tuples
It's cheap and we should be doing it. Especially because it _really_ helps us going forward.
1 parent 605f785 commit dea7093

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/transformations/tuples.jl

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,17 @@ geometries wrapping `Tuple` points.
1010
1111
# Keywords
1212
13-
$APPLY_KEYWORDS
13+
- `threaded`: `true` or `false`. Whether to use multithreading. Defaults to `false`.
14+
- `crs`: The CRS to attach to geometries. Defaults to `nothing`.
15+
- `calc_extent`: `true` or `false`. Whether to calculate the extent. Defaults to `true`.
1416
"""
15-
function tuples(geom, ::Type{T} = Float64; kw...) where T
17+
function tuples(geom, ::Type{T} = Float64; calc_extent = true, kw...) where T
1618
if _is3d(geom)
17-
return apply(PointTrait(), geom; kw...) do p
19+
return apply(PointTrait(), geom; calc_extent, kw...) do p
1820
(T(GI.x(p)), T(GI.y(p)), T(GI.z(p)))
1921
end
2022
else
21-
return apply(PointTrait(), geom; kw...) do p
23+
return apply(PointTrait(), geom; calc_extent, kw...) do p
2224
(T(GI.x(p)), T(GI.y(p)))
2325
end
2426
end

0 commit comments

Comments
 (0)