Struct geom::gps::LonLat [−][src]
Represents a (longitude, latitude) point.
Fields
longitude: NotNan<f64>
latitude: NotNan<f64>
Implementations
impl LonLat
[src]
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: &[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: &[LonLat]) -> LonLat
[src]
Finds the average of a set of coordinates.
pub fn parse_wkt_linestring(raw: &str) -> Option<Vec<LonLat>>
[src]
Parses a WKT-style line-string into a list of coordinates.
pub fn parse_geojson_polygons(raw: String) -> Result<Vec<Vec<LonLat>>>
[src]
Extract polygons from a raw GeoJSON string. For multipolygons, only returns the first member.
Trait Implementations
impl<'de> Deserialize<'de> 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 PartialOrd<LonLat> for LonLat
[src]
impl PartialOrd<LonLat> for LonLat
[src]impl Copy for LonLat
[src]
impl Eq for LonLat
[src]
impl StructuralEq for LonLat
[src]
impl StructuralPartialEq for LonLat
[src]
Auto Trait Implementations
impl RefUnwindSafe for LonLat
impl Send for LonLat
impl Sync for LonLat
impl Unpin for LonLat
impl UnwindSafe for LonLat
Blanket Implementations
impl<T> Same<T> for T
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,