rasterh3/axis.rs
1/// The order of the axis in the two-dimensional array
2#[derive(Copy, Clone)]
3#[allow(clippy::upper_case_acronyms)]
4pub enum AxisOrder {
5 /// `X,Y` ordering
6 XY,
7
8 /// `Y,X` ordering
9 ///
10 /// This is the order used by [github.com/georust/gdal](https://github.com/georust/gdal) (behind the `ndarray` feature gate)
11 YX,
12}
13
14impl AxisOrder {
15 pub const fn x_axis(&self) -> usize {
16 match self {
17 Self::XY => 0,
18 Self::YX => 1,
19 }
20 }
21
22 pub const fn y_axis(&self) -> usize {
23 match self {
24 Self::XY => 1,
25 Self::YX => 0,
26 }
27 }
28}