pub struct NadGridReader<T: Reader> {
pub key: String,
/* private fields */
}Expand description
§NAD Grid Reader
§Description
Loads/reads a binary NTv2 file (.gsb)
Implements the FeatureReader trait
It should be noted that a proj4 Transformer usually uses this class internally. But if you want to manually parse a .gsb file, you can use this class directly.
§Usage
The methods you have access to:
NadGridReader::new: Create a new NadGridReaderNadGridReader::len: Get the length of the feature countNadGridReader::is_empty: Check if the reader is emptyNadGridReader::header: Read the headerNadGridReader::get_points: Read a subgrid into a PointNadGridReader::get_feature: Read a subgrid into a Vector FeatureNadGridReader::iter: Create an iterator to collect the featuresNadGridReader::par_iter: Create a parallel iterator to collect the features
use gistools::{parsers::{FeatureReader, FileReader}, readers::NadGridReader};
use std::path::PathBuf;
let mut path = PathBuf::from(env!("CARGO_MANIFEST_DIR"));
path.push("tests/proj4/fixtures/BETA2007.gsb");
let nadgrid_reader = NadGridReader::new("test".into(), FileReader::from(path.clone()));
let features = nadgrid_reader.iter().collect::<Vec<_>>();
assert_eq!(features.len(), 1);§Links
Fields§
§key: StringThe name of the grid
Implementations§
Source§impl<T: Reader> NadGridReader<T>
impl<T: Reader> NadGridReader<T>
Sourcepub fn header(&self) -> &NadGridHeader
pub fn header(&self) -> &NadGridHeader
read the header
Sourcepub fn get_points(&self, index: u64) -> Option<VectorMultiPoint>
pub fn get_points(&self, index: u64) -> Option<VectorMultiPoint>
Read a subgrid into a Point
Sourcepub fn get_feature(&self, index: u64) -> Option<NadVectorFeature>
pub fn get_feature(&self, index: u64) -> Option<NadVectorFeature>
Read a subgrid into a Vector Feature
Trait Implementations§
Source§impl<T: Clone + Reader> Clone for NadGridReader<T>
impl<T: Clone + Reader> Clone for NadGridReader<T>
Source§fn clone(&self) -> NadGridReader<T>
fn clone(&self) -> NadGridReader<T>
Returns a duplicate of the value. Read more
1.0.0§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<T: Reader> FeatureReader<NadMetadata, Map<String, ValueType>, Map<String, ValueType>> for NadGridReader<T>
A feature reader trait with a callback-based approach
impl<T: Reader> FeatureReader<NadMetadata, Map<String, ValueType>, Map<String, ValueType>> for NadGridReader<T>
A feature reader trait with a callback-based approach
Source§type FeatureIterator<'a> = NadGridIterator<'a, T>
where
T: 'a
type FeatureIterator<'a> = NadGridIterator<'a, T> where T: 'a
The Feature Reader should implement an iterator of some kind
Source§fn iter(&self) -> Self::FeatureIterator<'_>
fn iter(&self) -> Self::FeatureIterator<'_>
All readers have an iter function that returns a Iterator struct
Auto Trait Implementations§
impl<T> Freeze for NadGridReader<T>where
T: Freeze,
impl<T> RefUnwindSafe for NadGridReader<T>where
T: RefUnwindSafe,
impl<T> Send for NadGridReader<T>where
T: Send,
impl<T> Sync for NadGridReader<T>where
T: Sync,
impl<T> Unpin for NadGridReader<T>where
T: Unpin,
impl<T> UnwindSafe for NadGridReader<T>where
T: UnwindSafe,
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)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