pub enum CoordSeq<T> {
Point(T),
Linestring(Vec<T>),
Polygon(Vec<Vec<T>>),
Multipoint(Vec<T>),
Multilinestring(Vec<Vec<T>>),
Multipolygon(Vec<Vec<Vec<T>>>),
Geometrycollection(Vec<CoordSeq<T>>),
Polyhedralsurface(Vec<Vec<Vec<T>>>),
Triangulatedsurface(Vec<Vec<T>>),
Triangle(Vec<T>),
Solid(Vec<Vec<Vec<Vec<T>>>>),
Multisolid(Vec<Vec<Vec<Vec<Vec<T>>>>>),
}
Expand description
Coordinates corresponding to the shapes described by SFCGAL Geometry types.
Used to construct SFCGeometry from coordinates or to retrieve coordinates from SFCGeometry.
use sfcgal::{CoordSeq, ToSFCGAL};
let coordinates = CoordSeq::Linestring(vec![(-0.5, -0.5, 2.5), (0., 0., 4.0)]);
let line_3d = coordinates.to_sfcgal().unwrap();
assert!(line_3d.is_valid().unwrap());
use sfcgal::{SFCGeometry, CoordSeq, Point3d, ToCoordinates};
let line_3d = SFCGeometry::new("LINESTRING (3.5 5.6 1.0,4.8 10.5 1.0)").unwrap();
let coordinates = line_3d.to_coordinates::<Point3d>().unwrap();
// assert_eq!(coordinates, CoordSeq::Linestring(vec![(3.5, 5.6, 1.0), (4.8, 10.5, 1.0)]));
Variants§
Point(T)
A Point is described by a tuple of 2 or 3 coordinates.
Linestring(Vec<T>)
A Linestring is described by Vec of Point.
Polygon(Vec<Vec<T>>)
A Polygon is described by a Vec of closed Linestring : the first one is the exterior ring and the others are interior rings.
Multipoint(Vec<T>)
A Multipoint is described by a Vec of Points.
Multilinestring(Vec<Vec<T>>)
A Multilinestring is described by a Vec of Linestrings.
Multipolygon(Vec<Vec<Vec<T>>>)
A Multipolygon is described by a Vec of Polygons.
Geometrycollection(Vec<CoordSeq<T>>)
A Geometrycollection is described by a Vec of any of these CoordSeq geometries.
Polyhedralsurface(Vec<Vec<Vec<T>>>)
A Polyhedralsurface is described by a Vec of Polygons.
Triangulatedsurface(Vec<Vec<T>>)
A Triangulatedsurface is described by a Vec of Triangles.
Triangle(Vec<T>)
A Triangle is described by a Vec of 3 Points.
Solid(Vec<Vec<Vec<Vec<T>>>>)
A Solid is described by a Vec of Polyhedralsurfaces : the first one is the exterior shell and the others are interior shells.
Multisolid(Vec<Vec<Vec<Vec<Vec<T>>>>>)
A Multisolid is described by a Vec of Solids.
Trait Implementations§
source§impl<U> ToGeoJSON for CoordSeq<U>where
U: FromSlice + CoordType + ToVec + FromSFCGALGeom,
impl<U> ToGeoJSON for CoordSeq<U>where
U: FromSlice + CoordType + ToVec + FromSFCGALGeom,
type Err = Error
fn to_geojson<T: FromSlice + CoordType + ToVec + FromSFCGALGeom>( &self, ) -> Result<GeometryValue>
source§impl<T: ToSFCGALGeom + CoordType> ToSFCGAL for CoordSeq<T>
impl<T: ToSFCGALGeom + CoordType> ToSFCGAL for CoordSeq<T>
Convert coordinates (tuple of 2 or 3 members) to SFCGeometry
using
the corresponding CoordSeq
variant of the wanted geometry.
source§fn to_sfcgal(&self) -> Result<SFCGeometry>
fn to_sfcgal(&self) -> Result<SFCGeometry>
Convert the coordinates of this CoordSeq
to SFCGeometry
.
source§impl TryInto<Geometry> for CoordSeq<Point2d>
impl TryInto<Geometry> for CoordSeq<Point2d>
Implements conversion from CoordSeq to geo_types::Geometry (better use TryInto<geo_types::Geometry> for SFCGeometry if the intend is to convert SFCGAL Geometries to geo_types ones)
impl<T> StructuralPartialEq for CoordSeq<T>
Auto Trait Implementations§
impl<T> Freeze for CoordSeq<T>where
T: Freeze,
impl<T> RefUnwindSafe for CoordSeq<T>where
T: RefUnwindSafe,
impl<T> Send for CoordSeq<T>where
T: Send,
impl<T> Sync for CoordSeq<T>where
T: Sync,
impl<T> Unpin for CoordSeq<T>where
T: Unpin,
impl<T> UnwindSafe for CoordSeq<T>where
T: UnwindSafe,
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)