pub struct Geometry { /* private fields */ }
Expand description
OGR Geometry
Implementations
sourceimpl Geometry
impl Geometry
sourcepub unsafe fn lazy_feature_geometry() -> Geometry
pub unsafe fn lazy_feature_geometry() -> Geometry
Create a new Geometry without a C pointer
Safety
This method returns a Geometry without wrapped pointer
pub fn has_gdal_ptr(&self) -> bool
sourcepub unsafe fn set_c_geometry(&self, c_geometry: OGRGeometryH)
pub unsafe fn set_c_geometry(&self, c_geometry: OGRGeometryH)
pub fn empty(wkb_type: Type) -> Result<Geometry>
pub fn is_empty(&self) -> bool
sourcepub fn from_wkb(wkb: &[u8]) -> Result<Geometry>
pub fn from_wkb(wkb: &[u8]) -> Result<Geometry>
Creates a geometry by parsing a slice of bytes in WKB (Well-Known Binary) format.
sourcepub fn bbox(w: f64, s: f64, e: f64, n: f64) -> Result<Geometry>
pub fn bbox(w: f64, s: f64, e: f64, n: f64) -> Result<Geometry>
Create a rectangular geometry from West, South, East and North values.
sourcepub fn wkb(&self) -> Result<Vec<u8>>
pub fn wkb(&self) -> Result<Vec<u8>>
Serializes the geometry to WKB (Well-Known Binary) format.
sourcepub unsafe fn c_geometry(&self) -> OGRGeometryH
pub unsafe fn c_geometry(&self) -> OGRGeometryH
sourcepub unsafe fn into_c_geometry(self) -> OGRGeometryH
pub unsafe fn into_c_geometry(self) -> OGRGeometryH
pub fn set_point(&mut self, i: usize, point: (f64, f64, f64))
pub fn set_point_2d(&mut self, i: usize, p: (f64, f64))
pub fn add_point(&mut self, p: (f64, f64, f64))
pub fn add_point_2d(&mut self, p: (f64, f64))
pub fn get_point(&self, i: i32) -> (f64, f64, f64)
pub fn get_point_vec(&self) -> Vec<(f64, f64, f64)>
sourcepub fn convex_hull(&self) -> Result<Geometry>
pub fn convex_hull(&self) -> Result<Geometry>
Compute the convex hull of this geometry.
pub fn delaunay_triangulation(&self, tolerance: Option<f64>) -> Result<Self>
pub fn simplify(&self, tolerance: f64) -> Result<Self>
sourcepub fn buffer(&self, distance: f64, n_quad_segs: u32) -> Result<Self>
pub fn buffer(&self, distance: f64, n_quad_segs: u32) -> Result<Self>
Compute buffer of geometry
The distance
parameter the buffer distance to be applied. Should be expressed into
the same unit as the coordinates of the geometry. n_quad_segs
specifies the number
of segments used to approximate a 90 degree (quadrant) of curvature.
pub fn simplify_preserve_topology(&self, tolerance: f64) -> Result<Self>
pub fn geometry_type(&self) -> Type
pub fn geometry_count(&self) -> usize
sourcepub unsafe fn get_unowned_geometry(&self, n: usize) -> Geometry
pub unsafe fn get_unowned_geometry(&self, n: usize) -> Geometry
sourcepub fn get_geometry(&self, index: usize) -> GeometryRef<'_>
pub fn get_geometry(&self, index: usize) -> GeometryRef<'_>
Get a reference to the geometry at given index
pub fn add_geometry(&mut self, sub: Geometry) -> Result<()>
pub fn transform_inplace(&mut self, htransform: &CoordTransform) -> Result<()>
pub fn transform(&self, htransform: &CoordTransform) -> Result<Geometry>
pub fn transform_to_inplace(&mut self, spatial_ref: &SpatialRef) -> Result<()>
sourcepub fn transform_to(&self, spatial_ref: &SpatialRef) -> Result<Geometry>
pub fn transform_to(&self, spatial_ref: &SpatialRef) -> Result<Geometry>
Transforms a geometrys coordinates into another SpatialRef
pub fn area(&self) -> f64
sourcepub fn spatial_ref(&self) -> Option<SpatialRef>
pub fn spatial_ref(&self) -> Option<SpatialRef>
May or may not contain a reference to a SpatialRef: if not, it returns
an Ok(None)
; if it does, it tries to build a SpatialRef. If that
succeeds, it returns an Ok(Some(SpatialRef)), otherwise, you get the
Err.