pub struct GeoKeyDirectory {
pub version: u16,
pub major_revision: u16,
pub minor_revision: u16,
pub keys: Vec<GeoKey>,
}Expand description
Parsed GeoKey directory.
Fields§
§version: u16§major_revision: u16§minor_revision: u16§keys: Vec<GeoKey>Implementations§
Source§impl GeoKeyDirectory
impl GeoKeyDirectory
Sourcepub fn new() -> GeoKeyDirectory
pub fn new() -> GeoKeyDirectory
Create an empty directory with default version (1.1.0).
Sourcepub fn parse(
directory: &[u16],
double_params: &[f64],
ascii_params: &str,
) -> Option<GeoKeyDirectory>
pub fn parse( directory: &[u16], double_params: &[f64], ascii_params: &str, ) -> Option<GeoKeyDirectory>
Parse the GeoKey directory from the three GeoTIFF tags.
directory: contents of tag 34735 (SHORT array)double_params: contents of tag 34736 (DOUBLE array), may be emptyascii_params: contents of tag 34737 (ASCII), may be empty
Sourcepub fn get_double(&self, id: u16) -> Option<&[f64]>
pub fn get_double(&self, id: u16) -> Option<&[f64]>
Get double value(s) for a key.
Sourcepub fn set(&mut self, id: u16, value: GeoKeyValue)
pub fn set(&mut self, id: u16, value: GeoKeyValue)
Insert or replace a GeoKey.
Sourcepub fn serialize(&self) -> (Vec<u16>, Vec<f64>, String)
pub fn serialize(&self) -> (Vec<u16>, Vec<f64>, String)
Serialize the directory into the three TIFF tag payloads.
Returns (directory_shorts, double_params, ascii_params).
Keys are sorted by ID per spec. Short values go inline (location=0),
Double values reference the double_params array (location=34736),
Ascii values reference the ascii_params string (location=34737).
Trait Implementations§
Source§impl Clone for GeoKeyDirectory
impl Clone for GeoKeyDirectory
Source§fn clone(&self) -> GeoKeyDirectory
fn clone(&self) -> GeoKeyDirectory
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for GeoKeyDirectory
impl Debug for GeoKeyDirectory
Source§impl Default for GeoKeyDirectory
impl Default for GeoKeyDirectory
Source§fn default() -> GeoKeyDirectory
fn default() -> GeoKeyDirectory
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for GeoKeyDirectory
impl RefUnwindSafe for GeoKeyDirectory
impl Send for GeoKeyDirectory
impl Sync for GeoKeyDirectory
impl Unpin for GeoKeyDirectory
impl UnsafeUnpin for GeoKeyDirectory
impl UnwindSafe for GeoKeyDirectory
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more