geoarrow_array/test/
rect.rs

1use geo_types::{Rect, coord};
2use geoarrow_schema::{BoxType, Dimension};
3
4use crate::array::RectArray;
5use crate::builder::RectBuilder;
6
7pub(crate) fn r0() -> Rect {
8    Rect::new(coord! { x: 10., y: 20. }, coord! { x: 30., y: 10. })
9}
10
11pub(crate) fn r1() -> Rect {
12    Rect::new(coord! { x: 100., y: 200. }, coord! { x: 300., y: 100. })
13}
14
15pub(crate) fn r_array() -> RectArray {
16    let geoms = [Some(r0()), None, Some(r1()), None];
17    let typ = BoxType::new(Dimension::XY, Default::default());
18    RectBuilder::from_nullable_rects(geoms.iter().map(|x| x.as_ref()), typ).finish()
19}