Skip to content

Commit 5fb92aa

Browse files
authored
Add Extent overrides for Rect3 (Z) and Rect4 (ZM).
1 parent 138fd1c commit 5fb92aa

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

src/geointerface.jl

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,4 +153,14 @@ end
153153
function Extents.extent(rect::Rect2)
154154
(xmin, ymin), (xmax, ymax) = extrema(rect)
155155
return Extents.Extent(X=(xmin, xmax), Y=(ymin, ymax))
156-
end
156+
end
157+
158+
function Extents.extent(rect::Rect3)
159+
(xmin, ymin, zmin), (xmax, ymax, zmax) = extrema(rect)
160+
return Extents.Extent(X=(xmin, xmax), Y=(ymin, ymax), Z = (zmin, zmax))
161+
end
162+
163+
function Extents.extent(rect::Rect4)
164+
(xmin, ymin, zmin, mmin), (xmax, ymax, zmax, mmax) = extrema(rect)
165+
return Extents.Extent(X=(xmin, xmax), Y=(ymin, ymax), Z = (zmin, zmax), M = (mmin, mmax))
166+
end

0 commit comments

Comments
 (0)