pub struct Line { /* private fields */ }
Expand description
A line has the geometry and threshold of a contour ring, built by [ContourBuilder
].
Implementations§
source§impl Line
impl Line
sourcepub fn geometry(&self) -> &MultiLineString<Float>
pub fn geometry(&self) -> &MultiLineString<Float>
Borrow the MultiLineString
geometry of this contour.
sourcepub fn into_inner(self) -> (MultiLineString<Float>, Float)
pub fn into_inner(self) -> (MultiLineString<Float>, Float)
Get the owned lines and threshold of this contour.
sourcepub fn to_geojson(&self) -> Feature
Available on crate feature geojson
only.
pub fn to_geojson(&self) -> Feature
geojson
only.Convert the line to a struct from the geojson
crate.
To get a string representation, call to_geojson().to_string().
use contour::ContourBuilder;
let builder = ContourBuilder::new(10, 10, false);
let contours = builder.lines(&[
// ...ellided for brevity
], &[0.5]).unwrap();
let geojson_string = contours[0].to_geojson().to_string();
assert_eq!(&geojson_string[0..27], r#"{"geometry":{"coordinates":"#);
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Line
impl RefUnwindSafe for Line
impl Send for Line
impl Sync for Line
impl Unpin for Line
impl UnwindSafe for Line
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