s2json_core/geometry/mod.rs
1/// BBox and BBox3D shapes and utilities
2pub mod bbox;
3/// Impls that we want to hide to make the code more readable
4pub mod impls;
5/// Primitive geometry types (used by GeoJSON spec)
6pub mod primitive;
7/// Vector geometry types (used by the s2json spec for both WGS84 and S2Geometry)
8pub mod vector;
9/// The VectorPoint struct is a powerful tool for 2D and 3D points
10pub mod vector_point;
11
12use crate::{Face, MValue};
13pub use bbox::*;
14pub use primitive::*;
15use serde::{Deserialize, Serialize};
16pub use vector::*;
17pub use vector_point::*;
18
19/// The axis to apply an operation to
20#[derive(Debug, PartialEq, Eq, Clone, Copy)]
21pub enum Axis {
22 /// X axis
23 X = 0,
24 /// Y axis
25 Y = 1,
26}
27
28/// A Point in S2 Space with a Face
29#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Default)]
30pub struct STPoint<M = MValue> {
31 /// The face of the point
32 pub face: Face,
33 /// The s coordinate
34 pub s: f64,
35 /// The t coordinate
36 pub t: f64,
37 /// The z coordinate
38 pub z: Option<f64>,
39 /// The m coordinate
40 pub m: Option<M>,
41}