Trait geoarrow2::algorithm::geo::dimensions::HasDimensions
source · pub trait HasDimensions {
// Required method
fn is_empty(&self) -> BooleanArray;
}
Expand description
Operate on the dimensionality of geometries.
Required Methods§
sourcefn is_empty(&self) -> BooleanArray
fn is_empty(&self) -> BooleanArray
Some geometries, like a MultiPoint
, can have zero coordinates - we call these empty
.
Types like Point
and Rect
, which have at least one coordinate by construction, can
never be considered empty.
use geo::{Point, coord, LineString};
use geo::HasDimensions;
let line_string = LineString::new(vec![
coord! { x: 0., y: 0. },
coord! { x: 10., y: 0. },
]);
assert!(!line_string.is_empty());
let empty_line_string: LineString = LineString::new(vec![]);
assert!(empty_line_string.is_empty());
let point = Point::new(0.0, 0.0);
assert!(!point.is_empty());