Expand description
Represents a rectangular boundary of LonLat
points. After building one of these, LonLat
s
can be transformed into Pt2D
s, treating the top-left of the boundary as (0, 0), and growing
to the right and down (screen-drawing order, not Cartesian) in meters.
Fields
min_lon: f64
min_lat: f64
max_lon: f64
max_lat: f64
Implementations
sourceimpl GPSBounds
impl GPSBounds
sourcepub fn get_max_world_pt(&self) -> Pt2D
pub fn get_max_world_pt(&self) -> Pt2D
The bottom-right corner of the boundary, in map-space.
sourcepub fn try_convert(&self, pts: &[LonLat]) -> Option<Vec<Pt2D>>
pub fn try_convert(&self, pts: &[LonLat]) -> Option<Vec<Pt2D>>
Convert all points to map-space, failing if any points are outside this boundary.
sourcepub fn convert(&self, pts: &[LonLat]) -> Vec<Pt2D>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
pub fn convert(&self, pts: &[LonLat]) -> Vec<Pt2D>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
A: Allocator,
Convert all points to map-space. The points may be outside this boundary.
sourcepub fn convert_back(&self, pts: &[Pt2D]) -> Vec<LonLat>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
pub fn convert_back(&self, pts: &[Pt2D]) -> Vec<LonLat>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
A: Allocator,
Convert map-space points back to LonLat
s. This is only valid if the GPSBounds
used
is the same as the one used to originally produce the Pt2D
s.
pub fn convert_back_xy(&self, x: f64, y: f64) -> LonLat
Trait Implementations
sourceimpl<'de> Deserialize<'de> for GPSBounds
impl<'de> Deserialize<'de> for GPSBounds
sourcefn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl StructuralPartialEq for GPSBounds
Auto Trait Implementations
impl RefUnwindSafe for GPSBounds
impl Send for GPSBounds
impl Sync for GPSBounds
impl Unpin for GPSBounds
impl UnwindSafe for GPSBounds
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more