Struct geos::ConstGeometry
source · pub struct ConstGeometry<'a> { /* private fields */ }
Expand description
only not mutable operations are implemented on it.
§Example
use geos::{Geom, Geometry};
let geom = Geometry::new_from_wkt("POLYGON((0 0, 10 0, 10 6, 0 6, 0 0),\
(1 1, 2 1, 2 5, 1 5, 1 1),\
(8 5, 8 4, 9 4, 9 5, 8 5))")
.expect("Invalid geometry");
let point_geom = geom
.get_interior_ring_n(0)
.expect("failed to get const geometry");
Implementations§
source§impl<'b> ConstGeometry<'b>
impl<'b> ConstGeometry<'b>
sourcepub fn get_context_handle(&self) -> &ContextHandle
pub fn get_context_handle(&self) -> &ContextHandle
Get the context handle of the geometry.
use geos::{ContextInteractions, Geometry};
let point_geom = Geometry::new_from_wkt("POINT (2.5 2.5)").expect("Invalid geometry");
let context = point_geom.get_context_handle();
context.set_notice_message_handler(Some(Box::new(|s| println!("new message: {}", s))));
Trait Implementations§
source§impl<'a> ContextHandling for ConstGeometry<'a>
impl<'a> ContextHandling for ConstGeometry<'a>
type Context = Arc<ContextHandle>
fn clone_context(&self) -> Arc<ContextHandle>
source§impl<'d> Geom for ConstGeometry<'d>
impl<'d> Geom for ConstGeometry<'d>
fn geometry_type(&self) -> GeometryTypes
source§fn is_valid_reason(&self) -> GResult<String>
fn is_valid_reason(&self) -> GResult<String>
Returns an explanation on why the geometry is invalid. Read more
source§fn get_coord_seq(&self) -> GResult<CoordSeq>
fn get_coord_seq(&self) -> GResult<CoordSeq>
Get the underlying geos CoordSeq object from the geometry Read more
source§fn area(&self) -> GResult<f64>
fn area(&self) -> GResult<f64>
Returns the area of the geometry. Units are specified by the SRID of the given geometry. Read more
source§fn to_wkt_precision(&self, precision: u32) -> GResult<String>
fn to_wkt_precision(&self, precision: u32) -> GResult<String>
Returns a WKT representation of the geometry with the given
precision
. It is a wrapper
around WKTWriter::set_rounding_precision
. Read moresource§fn touches<G: Geom>(&self, other: &G) -> GResult<bool>
fn touches<G: Geom>(&self, other: &G) -> GResult<bool>
Returns
true
if the only points in common between self
and other
lie in the union of
the boundaries of self
and other
. Read moresource§fn buffer(&self, width: f64, quadsegs: i32) -> GResult<Geometry>
fn buffer(&self, width: f64, quadsegs: i32) -> GResult<Geometry>
Returns a geometry which represents all points whose distance from
self
is less than or
equal to distance. Read moresource§fn buffer_with_params(
&self,
width: f64,
buffer_params: &BufferParams
) -> GResult<Geometry>
fn buffer_with_params( &self, width: f64, buffer_params: &BufferParams ) -> GResult<Geometry>
Returns a geometry which represents all points whose distance from
self
is less than or
equal to distance. Read moresource§fn buffer_with_style(
&self,
width: f64,
quadsegs: i32,
end_cap_style: CapStyle,
join_style: JoinStyle,
mitre_limit: f64
) -> GResult<Geometry>
fn buffer_with_style( &self, width: f64, quadsegs: i32, end_cap_style: CapStyle, join_style: JoinStyle, mitre_limit: f64 ) -> GResult<Geometry>
Returns a geometry which represents all points whose distance from
self
is less than or
equal to distance. Read moresource§fn is_simple(&self) -> GResult<bool>
fn is_simple(&self) -> GResult<bool>
Returns true if the given geometry has no anomalous geometric points, such as self
intersection or self tangency. Read more
source§fn envelope(&self) -> GResult<Geometry>
fn envelope(&self) -> GResult<Geometry>
Returns the minimum bouding box of the given geometry. Read more
source§fn union<G: Geom>(&self, other: &G) -> GResult<Geometry>
fn union<G: Geom>(&self, other: &G) -> GResult<Geometry>
Aggregates the given geometry with another one. Read more
source§fn get_centroid(&self) -> GResult<Geometry>
fn get_centroid(&self) -> GResult<Geometry>
Returns the geometric center or (equivalently) the center of mass of the given geometry as
a point. Read more
source§fn voronoi<G: Geom>(
&self,
envelope: Option<&G>,
tolerance: f64,
only_edges: bool
) -> GResult<Geometry>
fn voronoi<G: Geom>( &self, envelope: Option<&G>, tolerance: f64, only_edges: bool ) -> GResult<Geometry>
Create a voronoi diagram. Read more
source§fn boundary(&self) -> GResult<Geometry>
fn boundary(&self) -> GResult<Geometry>
Returns the closure of the combinatorial boundary of
self
. Read moresource§fn is_closed(&self) -> GResult<bool>
fn is_closed(&self) -> GResult<bool>
Returns
true
if start and end point are coincident. Read moresource§fn length(&self) -> GResult<f64>
fn length(&self) -> GResult<f64>
Returns the length of
self
. The unit depends of the SRID. Read moresource§fn hausdorff_distance_densify<G: Geom>(
&self,
other: &G,
distance_frac: f64
) -> GResult<f64>
fn hausdorff_distance_densify<G: Geom>( &self, other: &G, distance_frac: f64 ) -> GResult<f64>
source§fn extract_unique_points(&self) -> GResult<Geometry>
fn extract_unique_points(&self) -> GResult<Geometry>
Returns unique points of
self
.fn nearest_points<G: Geom>(&self, other: &G) -> GResult<CoordSeq>
source§fn get_point_n(&self, n: usize) -> GResult<Geometry>
fn get_point_n(&self, n: usize) -> GResult<Geometry>
Returns the nth point of the given geometry. Read more
source§fn get_num_interior_rings(&self) -> GResult<usize>
fn get_num_interior_rings(&self) -> GResult<usize>
Returns the number of interior rings. Read more
source§fn get_num_coordinates(&self) -> GResult<usize>
fn get_num_coordinates(&self) -> GResult<usize>
Returns the number of coordinates inside
self
. Read moresource§fn get_num_dimensions(&self) -> GResult<usize>
fn get_num_dimensions(&self) -> GResult<usize>
Returns the number of dimensions used in
self
. Read moresource§fn get_coordinate_dimension(&self) -> GResult<Dimensions>
fn get_coordinate_dimension(&self) -> GResult<Dimensions>
Return in which coordinate dimension the geometry is. Read more
source§fn make_valid(&self) -> GResult<Geometry>
fn make_valid(&self) -> GResult<Geometry>
This functions attempts to return a valid representation of
self
. Read moresource§fn set_precision(&self, grid_size: f64, flags: Precision) -> GResult<Geometry>
fn set_precision(&self, grid_size: f64, flags: Precision) -> GResult<Geometry>
Returns the precision of
self
. Read moresource§fn minimum_clearance(&self) -> GResult<f64>
fn minimum_clearance(&self) -> GResult<f64>
Returns the smallest distance by which a vertex of
self
could be moved to produce an
invalid geometry. Read moresource§fn minimum_clearance_line(&self) -> GResult<Geometry>
fn minimum_clearance_line(&self) -> GResult<Geometry>
Returns the two-point LineString spanning of
self
’s minimum clearance. Read moresource§fn minimum_rotated_rectangle(&self) -> GResult<Geometry>
fn minimum_rotated_rectangle(&self) -> GResult<Geometry>
Returns the minimum rotated rectangle inside of
self
. Read moresource§fn minimum_width(&self) -> GResult<Geometry>
fn minimum_width(&self) -> GResult<Geometry>
Returns the minimum width inside of
self
. Read morefn interpolate(&self, d: f64) -> GResult<Geometry>
fn interpolate_normalized(&self, d: f64) -> GResult<Geometry>
fn project<G: Geom>(&self, p: &G) -> GResult<f64>
fn project_normalized<G: Geom>(&self, p: &G) -> GResult<f64>
fn node(&self) -> GResult<Geometry>
source§fn offset_curve(
&self,
width: f64,
quadrant_segments: i32,
join_style: JoinStyle,
mitre_limit: f64
) -> GResult<Geometry>
fn offset_curve( &self, width: f64, quadrant_segments: i32, join_style: JoinStyle, mitre_limit: f64 ) -> GResult<Geometry>
Return an offset line at a given distance and side from an input line. All points of the
returned geometries are not further than the given distance from the input geometry. Read more
fn point_on_surface(&self) -> GResult<Geometry>
source§fn polygonize_full(
&self
) -> GResult<(Geometry, Option<Geometry>, Option<Geometry>, Option<Geometry>)>
fn polygonize_full( &self ) -> GResult<(Geometry, Option<Geometry>, Option<Geometry>, Option<Geometry>)>
Returns, in the tuple elements order: Read more
source§fn to_prepared_geom<'c>(&'c self) -> GResult<PreparedGeometry>
fn to_prepared_geom<'c>(&'c self) -> GResult<PreparedGeometry>
source§fn get_geometry_n(&self, n: usize) -> GResult<ConstGeometry<'_>>
fn get_geometry_n(&self, n: usize) -> GResult<ConstGeometry<'_>>
Returns the 1-based nth geometry. Read more
source§fn get_interior_ring_n(&self, n: u32) -> GResult<ConstGeometry<'_>>
fn get_interior_ring_n(&self, n: u32) -> GResult<ConstGeometry<'_>>
Returns the nth interior ring. Read more
source§fn get_exterior_ring(&self) -> GResult<ConstGeometry<'_>>
fn get_exterior_ring(&self) -> GResult<ConstGeometry<'_>>
Returns the exterior ring. Read more
source§impl<'d, G: Geom> PartialEq<G> for ConstGeometry<'d>
impl<'d, G: Geom> PartialEq<G> for ConstGeometry<'d>
source§impl<'c> TryFrom<ConstGeometry<'c>> for Geometry
impl<'c> TryFrom<ConstGeometry<'c>> for Geometry
impl<'d> Send for ConstGeometry<'d>
impl<'d> Sync for ConstGeometry<'d>
Auto Trait Implementations§
impl<'a> Freeze for ConstGeometry<'a>
impl<'a> RefUnwindSafe for ConstGeometry<'a>
impl<'a> Unpin for ConstGeometry<'a>
impl<'a> UnwindSafe for ConstGeometry<'a>
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