lib

Core libraries for Radroots
git clone https://radroots.dev/git/lib.git
Log | Files | Refs | README

gcs.rs (1730B)


      1 #[cfg(not(feature = "std"))]
      2 use alloc::{string::String, vec::Vec};
      3 
      4 #[cfg_attr(all(test, feature = "std"), derive(dto_bindgen::Dto))]
      5 #[cfg_attr(all(test, feature = "std"), dto(export))]
      6 #[cfg_attr(
      7     any(feature = "serde", test),
      8     derive(serde::Serialize, serde::Deserialize)
      9 )]
     10 #[derive(Clone, Debug)]
     11 pub struct GeoJsonPoint {
     12     #[cfg_attr(any(feature = "serde", test), serde(rename = "type"))]
     13     pub r#type: String,
     14     pub coordinates: [f64; 2],
     15 }
     16 
     17 #[cfg_attr(all(test, feature = "std"), derive(dto_bindgen::Dto))]
     18 #[cfg_attr(all(test, feature = "std"), dto(export))]
     19 #[cfg_attr(
     20     any(feature = "serde", test),
     21     derive(serde::Serialize, serde::Deserialize)
     22 )]
     23 #[derive(Clone, Debug)]
     24 pub struct GeoJsonPolygon {
     25     #[cfg_attr(any(feature = "serde", test), serde(rename = "type"))]
     26     pub r#type: String,
     27     pub coordinates: Vec<Vec<[f64; 2]>>,
     28 }
     29 
     30 #[cfg_attr(all(test, feature = "std"), derive(dto_bindgen::Dto))]
     31 #[cfg_attr(all(test, feature = "std"), dto(export))]
     32 #[cfg_attr(
     33     any(feature = "serde", test),
     34     derive(serde::Serialize, serde::Deserialize)
     35 )]
     36 #[derive(Clone, Debug)]
     37 pub struct GcsLocation {
     38     pub lat: f64,
     39     pub lng: f64,
     40     pub geohash: String,
     41     pub point: GeoJsonPoint,
     42     pub polygon: GeoJsonPolygon,
     43     pub accuracy: Option<f64>,
     44     pub altitude: Option<f64>,
     45     pub tag_0: Option<String>,
     46     pub label: Option<String>,
     47     pub area: Option<f64>,
     48     pub elevation: Option<u32>,
     49     pub soil: Option<String>,
     50     pub climate: Option<String>,
     51     pub gc_id: Option<String>,
     52     pub gc_name: Option<String>,
     53     pub gc_admin1_id: Option<String>,
     54     pub gc_admin1_name: Option<String>,
     55     pub gc_country_id: Option<String>,
     56     pub gc_country_name: Option<String>,
     57 }