pub struct GeoLocation {
pub geo_type: GeoType,
pub coordinates: Vec<(f64, f64)>,
pub srs_name: Option<String>,
}Expand description
Geographic location data from GeoRSS
Fields§
§geo_type: GeoTypeType of geographic shape
coordinates: Vec<(f64, f64)>Coordinate pairs as (latitude, longitude)
- Point: 1 coordinate pair
- Line: 2+ coordinate pairs
- Polygon: 3+ coordinate pairs (first == last for closed polygon)
- Box: 2 coordinate pairs (lower-left, upper-right)
srs_name: Option<String>Coordinate reference system (e.g., “EPSG:4326” for WGS84)
Default is WGS84 (latitude/longitude) if not specified
Implementations§
Source§impl GeoLocation
impl GeoLocation
Sourcepub fn bbox(
lower_lat: f64,
lower_lon: f64,
upper_lat: f64,
upper_lon: f64,
) -> Self
pub fn bbox( lower_lat: f64, lower_lon: f64, upper_lat: f64, upper_lon: f64, ) -> Self
Creates new bounding box location
§Arguments
lower_lat- Lower-left latitudelower_lon- Lower-left longitudeupper_lat- Upper-right latitudeupper_lon- Upper-right longitude
§Examples
use feedparser_rs::namespace::georss::GeoLocation;
let loc = GeoLocation::bbox(45.0, -72.0, 46.0, -71.0);
assert_eq!(loc.coordinates.len(), 2);Trait Implementations§
Source§impl Clone for GeoLocation
impl Clone for GeoLocation
Source§fn clone(&self) -> GeoLocation
fn clone(&self) -> GeoLocation
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for GeoLocation
impl Debug for GeoLocation
Source§impl Default for GeoLocation
impl Default for GeoLocation
Source§fn default() -> GeoLocation
fn default() -> GeoLocation
Returns the “default value” for a type. Read more
Source§impl PartialEq for GeoLocation
impl PartialEq for GeoLocation
impl StructuralPartialEq for GeoLocation
Auto Trait Implementations§
impl Freeze for GeoLocation
impl RefUnwindSafe for GeoLocation
impl Send for GeoLocation
impl Sync for GeoLocation
impl Unpin for GeoLocation
impl UnwindSafe for GeoLocation
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