pub struct Plain { /* private fields */ }
Expand description
A context provider, supporting built in and run-time defined operators, external grids, and macros. Sufficient for most uses, especially geodetic grid development. May get somewhat clunky when working with large numbers of grids or macros, as each reside in its own file.
Implementations§
source§impl Plain
impl Plain
sourcepub fn clear_grids()
pub fn clear_grids()
To avoid having the heap allocated collection of grids stored in GRIDS
growing through the roof, we may clear it occasionally.
As the grids are behind an Arc
reference counter, this is safe to do
even though they may still be in use by some remaining operator
instantiations.
Trait Implementations§
source§impl Context for Plain
impl Context for Plain
source§fn op(&mut self, definition: &str) -> Result<OpHandle, Error>
fn op(&mut self, definition: &str) -> Result<OpHandle, Error>
Instantiate an operator. Recognizes PROJ syntax and converts it to Geodesy syntax. Bear in mind, however, that Geodesy does not support all PROJ operators, and that the input/output conventions differ.
source§fn get_grid(&self, name: &str) -> Result<Arc<dyn Grid>, Error>
fn get_grid(&self, name: &str) -> Result<Arc<dyn Grid>, Error>
Access grid resources by identifier
source§fn new() -> Plain
fn new() -> Plain
new
differs from default
only by adding access to the builtin adaptors (geo:in
, gis:out
etc.)source§fn apply(
&self,
op: OpHandle,
direction: Direction,
operands: &mut dyn CoordinateSet
) -> Result<usize, Error>
fn apply( &self, op: OpHandle, direction: Direction, operands: &mut dyn CoordinateSet ) -> Result<usize, Error>
op
to operands
source§fn params(&self, op: OpHandle, index: usize) -> Result<ParsedParameters, Error>
fn params(&self, op: OpHandle, index: usize) -> Result<ParsedParameters, Error>
source§fn globals(&self) -> BTreeMap<String, String>
fn globals(&self) -> BTreeMap<String, String>
ellps=GRS80
)source§fn register_op(&mut self, name: &str, constructor: OpConstructor)
fn register_op(&mut self, name: &str, constructor: OpConstructor)
source§fn get_op(&self, name: &str) -> Result<OpConstructor, Error>
fn get_op(&self, name: &str) -> Result<OpConstructor, Error>
Op
instantiation logic in Op::op(...)