pub struct BoxType { /* private fields */ }Expand description
A GeoArrow “Box” or “Rect” type.
Refer to the GeoArrow specification.
Implementations§
Source§impl BoxType
impl BoxType
Sourcepub fn with_dimension(self, dim: Dimension) -> Self
pub fn with_dimension(self, dim: Dimension) -> Self
Change the underlying Dimension
Sourcepub fn with_metadata(self, metadata: Arc<Metadata>) -> Self
pub fn with_metadata(self, metadata: Arc<Metadata>) -> Self
Change the underlying Metadata
Sourcepub fn data_type(&self) -> DataType
pub fn data_type(&self) -> DataType
Convert to the corresponding DataType.
use arrow_schema::{DataType, Field};
use geoarrow_schema::{BoxType, Dimension};
let geom_type = BoxType::new(Dimension::XYZM, Default::default());
let expected_type = DataType::Struct(
vec![
Field::new("xmin", DataType::Float64, false),
Field::new("ymin", DataType::Float64, false),
Field::new("zmin", DataType::Float64, false),
Field::new("mmin", DataType::Float64, false),
Field::new("xmax", DataType::Float64, false),
Field::new("ymax", DataType::Float64, false),
Field::new("zmax", DataType::Float64, false),
Field::new("mmax", DataType::Float64, false),
]
.into(),
);
assert_eq!(geom_type.data_type(), expected_type);Trait Implementations§
Source§impl ExtensionType for BoxType
impl ExtensionType for BoxType
Source§fn metadata(&self) -> &Self::Metadata
fn metadata(&self) -> &Self::Metadata
Returns a reference to the metadata of this extension type, or
&() if
if this extension type defines no metadata (Self::Metadata=()).Source§fn serialize_metadata(&self) -> Option<String>
fn serialize_metadata(&self) -> Option<String>
Returns the serialized representation of the metadata of this extension
type, or
None if this extension type defines no metadata
(Self::Metadata=()). Read moreSource§fn deserialize_metadata(
metadata: Option<&str>,
) -> Result<Self::Metadata, ArrowError>
fn deserialize_metadata( metadata: Option<&str>, ) -> Result<Self::Metadata, ArrowError>
Deserialize the metadata of this extension type from the serialized
representation of the metadata. An extension type that defines no
metadata should expect
None for the serialized metadata and return
Ok(()). Read moreSource§fn supports_data_type(&self, data_type: &DataType) -> Result<(), ArrowError>
fn supports_data_type(&self, data_type: &DataType) -> Result<(), ArrowError>
Returns
Ok(()) iff the given data type is supported by this extension
type.Source§impl From<BoxType> for GeoArrowType
impl From<BoxType> for GeoArrowType
impl Eq for BoxType
impl StructuralPartialEq for BoxType
Auto Trait Implementations§
impl Freeze for BoxType
impl RefUnwindSafe for BoxType
impl Send for BoxType
impl Sync for BoxType
impl Unpin for BoxType
impl UnwindSafe for BoxType
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