pub struct PolygonHandler;Expand description
Polygon coordinate validator
Validates polygon coordinate strings in the format “(lat1,lon1,lat2,lon2,lat1,lon1)” and ensures proper polygon geometry (closed, minimum vertices, valid coordinates).
Implementations§
Source§impl PolygonHandler
impl PolygonHandler
pub fn validate_and_canonicalize( value: &str, field_name: &str, ) -> Result<String>
Sourcepub fn parse_polygon_coordinates(coord_string: &str) -> Result<Vec<(f64, f64)>>
pub fn parse_polygon_coordinates(coord_string: &str) -> Result<Vec<(f64, f64)>>
Parse a string of coordinates “(lat,lon,lat,lon,…)” into a vector of (lat, lon) tuples.
This function ALWAYS returns (lat, lon) DO NOT swap here. Only swap to (lon, lat) when passing to geo crate.
Sourcepub fn calculate_bounding_box(coordinates: &[(f64, f64)]) -> String
pub fn calculate_bounding_box(coordinates: &[(f64, f64)]) -> String
Calculates bounding box for spatial filtering optimization This will be used later when we handle the payload and headers
pub fn parse_bbox_coordinates(s: &str) -> Result<(f64, f64, f64, f64)>
Auto Trait Implementations§
impl Freeze for PolygonHandler
impl RefUnwindSafe for PolygonHandler
impl Send for PolygonHandler
impl Sync for PolygonHandler
impl Unpin for PolygonHandler
impl UnsafeUnpin for PolygonHandler
impl UnwindSafe for PolygonHandler
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more