Trait geo_postgis::FromPostgis
source · [−]pub trait FromPostgis<T> {
fn from_postgis(_: T) -> Self;
}
Expand description
Creates geometry from a PostGIS type.
Note that PostGIS databases can store data under any spatial reference system - not just WGS84. No attempt is made to convert data between reference systems.
Required Methods
fn from_postgis(_: T) -> Self
Implementations on Foreign Types
sourceimpl<'a, T> FromPostgis<&'a T> for Point where
T: Point,
impl<'a, T> FromPostgis<&'a T> for Point where
T: Point,
fn from_postgis(pt: &'a T) -> Self
sourceimpl<'a, T> FromPostgis<&'a T> for LineString where
T: LineString<'a>,
impl<'a, T> FromPostgis<&'a T> for LineString where
T: LineString<'a>,
fn from_postgis(ls: &'a T) -> Self
sourceimpl<'a, T> FromPostgis<&'a T> for Option<Polygon<f64>> where
T: Polygon<'a>,
impl<'a, T> FromPostgis<&'a T> for Option<Polygon<f64>> where
T: Polygon<'a>,
sourcefn from_postgis(poly: &'a T) -> Self
fn from_postgis(poly: &'a T) -> Self
This returns an Option
, because it’s possible for a PostGIS Polygon
to contain zero rings, which makes for an invalid geo::Polygon
.
sourceimpl<'a, T> FromPostgis<&'a T> for MultiPoint where
T: MultiPoint<'a>,
impl<'a, T> FromPostgis<&'a T> for MultiPoint where
T: MultiPoint<'a>,
fn from_postgis(mp: &'a T) -> Self
sourceimpl<'a, T> FromPostgis<&'a T> for MultiLineString where
T: MultiLineString<'a>,
impl<'a, T> FromPostgis<&'a T> for MultiLineString where
T: MultiLineString<'a>,
fn from_postgis(mp: &'a T) -> Self
sourceimpl<'a, T> FromPostgis<&'a T> for MultiPolygon where
T: MultiPolygon<'a>,
impl<'a, T> FromPostgis<&'a T> for MultiPolygon where
T: MultiPolygon<'a>,
sourcefn from_postgis(mp: &'a T) -> Self
fn from_postgis(mp: &'a T) -> Self
This implementation discards PostGIS polygons that don’t convert
(return None
when from_postgis()
is called on them).
sourceimpl<'a, T> FromPostgis<&'a GeometryCollectionT<T>> for GeometryCollection where
T: Point + EwkbRead,
impl<'a, T> FromPostgis<&'a GeometryCollectionT<T>> for GeometryCollection where
T: Point + EwkbRead,
sourcefn from_postgis(gc: &'a GeometryCollectionT<T>) -> Self
fn from_postgis(gc: &'a GeometryCollectionT<T>) -> Self
This implementation discards geometries that don’t convert
(return None
when from_postgis()
is called on them).
sourceimpl<'a, T> FromPostgis<&'a GeometryT<T>> for Option<Geometry> where
T: Point + EwkbRead,
impl<'a, T> FromPostgis<&'a GeometryT<T>> for Option<Geometry> where
T: Point + EwkbRead,
sourcefn from_postgis(geo: &'a GeometryT<T>) -> Self
fn from_postgis(geo: &'a GeometryT<T>) -> Self
This returns an Option
, because the supplied geometry
could be an invalid Polygon
.