pub struct Polygon {
pub exterior: Vec<(f64, f64)>,
pub interiors: Vec<Vec<(f64, f64)>>,
pub srid: Option<i32>,
}Expand description
A polygon (list of points forming a closed ring).
Fields§
§exterior: Vec<(f64, f64)>Exterior ring coordinates.
interiors: Vec<Vec<(f64, f64)>>Interior rings (holes).
srid: Option<i32>SRID.
Implementations§
Source§impl Polygon
impl Polygon
Sourcepub fn to_postgis(&self) -> String
pub fn to_postgis(&self) -> String
Generate PostGIS polygon.
Sourcepub fn to_geojson(&self) -> Value
pub fn to_geojson(&self) -> Value
Generate GeoJSON.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Polygon
impl<'de> Deserialize<'de> for Polygon
Source§fn 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 Polygon
Auto Trait Implementations§
impl Freeze for Polygon
impl RefUnwindSafe for Polygon
impl Send for Polygon
impl Sync for Polygon
impl Unpin for Polygon
impl UnwindSafe for Polygon
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