[−][src]Struct geom::gps::LonLat
Represents a (longitude, latitude) point.
Fields
longitude: NotNan<f64>
latitude: NotNan<f64>
Implementations
impl LonLat
[src]
pub fn new(lon: f64, lat: f64) -> LonLat
[src]
Note the order of arguments!
pub fn x(self) -> f64
[src]
Returns the longitude of this point.
pub fn y(self) -> f64
[src]
Returns the latitude of this point.
pub fn to_pt(self, b: &GPSBounds) -> Pt2D
[src]
Transform this to a world-space point. Can go out of bounds.
pub(crate) fn gps_dist(self, other: LonLat) -> Distance
[src]
Returns the Haversine distance to another point.
pub fn fast_dist(self, other: LonLat) -> NotNan<f64>
[src]
Pretty meaningless units, for comparing distances very roughly
pub fn read_osmosis_polygon(path: &str) -> Result<Vec<LonLat>>
[src]
Parses a file in the https://wiki.openstreetmap.org/wiki/Osmosis/Polygon_Filter_File_Format and returns all points.
pub fn write_osmosis_polygon(path: &str, pts: &Vec<LonLat>) -> Result<()>
[src]
Writes a set of points to a file in the https://wiki.openstreetmap.org/wiki/Osmosis/Polygon_Filter_File_Format. The input should be a closed ring, with the first and last point matching.
pub fn center(pts: &Vec<LonLat>) -> LonLat
[src]
Finds the average of a set of coordinates.
Trait Implementations
impl Clone for LonLat
[src]
impl Copy for LonLat
[src]
impl Debug for LonLat
[src]
impl<'de> Deserialize<'de> for LonLat
[src]
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
impl Display for LonLat
[src]
impl Eq for LonLat
[src]
impl From<LonLat> for Point<f64>
[src]
impl Ord for LonLat
[src]
fn cmp(&self, other: &LonLat) -> Ordering
[src]
#[must_use]pub fn max(self, other: Self) -> Self
1.21.0[src]
#[must_use]pub fn min(self, other: Self) -> Self
1.21.0[src]
#[must_use]pub fn clamp(self, min: Self, max: Self) -> Self
1.50.0[src]
impl PartialEq<LonLat> for LonLat
[src]
impl PartialOrd<LonLat> for LonLat
[src]
fn partial_cmp(&self, other: &LonLat) -> Option<Ordering>
[src]
fn lt(&self, other: &LonLat) -> bool
[src]
fn le(&self, other: &LonLat) -> bool
[src]
fn gt(&self, other: &LonLat) -> bool
[src]
fn ge(&self, other: &LonLat) -> bool
[src]
impl Serialize for LonLat
[src]
fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
__S: Serializer,
[src]
__S: Serializer,
impl StructuralEq for LonLat
[src]
impl StructuralPartialEq for LonLat
[src]
Auto Trait Implementations
impl RefUnwindSafe for LonLat
[src]
impl Send for LonLat
[src]
impl Sync for LonLat
[src]
impl Unpin for LonLat
[src]
impl UnwindSafe for LonLat
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,