PROJ C++ API
Public Types | Public Member Functions | Static Public Member Functions | List of all members
osgeo::proj::operation::CoordinateOperationContext Class Reference

Context in which a coordinate operation is to be used. More...

#include <coordinateoperation.hpp>

Public Types

enum  SourceTargetCRSExtentUse { SourceTargetCRSExtentUse::NONE, SourceTargetCRSExtentUse::BOTH, SourceTargetCRSExtentUse::INTERSECTION, SourceTargetCRSExtentUse::SMALLEST }
 
enum  SpatialCriterion { SpatialCriterion::STRICT_CONTAINMENT, SpatialCriterion::PARTIAL_INTERSECTION }
 
enum  GridAvailabilityUse { GridAvailabilityUse::USE_FOR_SORTING, GridAvailabilityUse::DISCARD_OPERATION_IF_MISSING_GRID, GridAvailabilityUse::IGNORE_GRID_AVAILABILITY }
 

Public Member Functions

io::AuthorityFactoryPtr getAuthorityFactory () const
 Return the authority factory, or null.
 
metadata::ExtentPtr getAreaOfInterest () const
 Return the desired area of interest, or null.
 
void setAreaOfInterest (const metadata::ExtentPtr &extent)
 Set the desired area of interest, or null.
 
double getDesiredAccuracy () const
 Return the desired accuracy (in metre), or 0.
 
void setDesiredAccuracy (double accuracy)
 Set the desired accuracy (in metre), or 0.
 
void setSourceAndTargetCRSExtentUse (SourceTargetCRSExtentUse use)
 Set how source and target CRS extent should be used when considering if a transformation can be used (only takes effect if no area of interest is explicitly defined). More...
 
SourceTargetCRSExtentUse getSourceAndTargetCRSExtentUse () const
 Return how source and target CRS extent should be used when considering if a transformation can be used (only takes effect if no area of interest is explicitly defined). More...
 
void setSpatialCriterion (SpatialCriterion criterion)
 Set the spatial criterion to use when comparing the area of validity of coordinate operations with the area of interest / area of validity of source and target CRS. More...
 
SpatialCriterion getSpatialCriterion () const
 Return the spatial criterion to use when comparing the area of validity of coordinate operations with the area of interest / area of validity of source and target CRS. More...
 
void setUsePROJAlternativeGridNames (bool usePROJNames)
 Set whether PROJ alternative grid names should be substituted to the official authority names. More...
 
bool getUsePROJAlternativeGridNames () const
 Return whether PROJ alternative grid names should be substituted to the official authority names. More...
 
void setGridAvailabilityUse (GridAvailabilityUse use)
 Set how grid availability is used. More...
 
GridAvailabilityUse getGridAvailabilityUse () const
 Return how grid availability is used. More...
 
void setAllowUseIntermediateCRS (bool use)
 Set whether an intermediate pivot CRS can be used for researching coordinate operations between a source and target CRS. More...
 
bool getAllowUseIntermediateCRS () const
 Return whether an intermediate pivot CRS can be used for researching coordinate operations between a source and target CRS. More...
 
void setIntermediateCRS (const std::vector< std::pair< std::string, std::string >> &intermediateCRSAuthCodes)
 Restrict the potential pivot CRSs that can be used when trying to build a coordinate operation between two CRS that have no direct operation. More...
 
const std::vector< std::pair< std::string, std::string > > & getIntermediateCRS () const
 Return the potential pivot CRSs that can be used when trying to build a coordinate operation between two CRS that have no direct operation. More...
 

Static Public Member Functions

static CoordinateOperationContextNNPtr create (const io::AuthorityFactoryPtr &authorityFactory, const metadata::ExtentPtr &extent, double accuracy)
 Creates a context for a coordinate operation. More...
 

Detailed Description

Context in which a coordinate operation is to be used.

Remarks
Implements [CoordinateOperationFactory https://sis.apache.org/apidocs/org/apache/sis/referencing/operation/CoordinateOperationContext.html] from Apache SIS

Member Enumeration Documentation

Describe how grid availability is used.

Enumerator
USE_FOR_SORTING 

Grid availability is only used for sorting results. Operations where some grids are missing will be sorted last.

DISCARD_OPERATION_IF_MISSING_GRID 

Completely discard an operation if a required grid is missing.

IGNORE_GRID_AVAILABILITY 

Ignore grid availability at all. Results will be presented as if all grids were available.

Specify how source and target CRS extent should be used to restrict candidate operations (only taken into account if no explicit area of interest is specified.

Enumerator
NONE 

Ignore CRS extent

BOTH 

Test coordinate operation extent against both CRS extent.

INTERSECTION 

Test coordinate operation extent against the intersection of both CRS extent.

SMALLEST 

Test coordinate operation against the smallest of both CRS extent.

Spatial criterion to restrict candiate operations.

Enumerator
STRICT_CONTAINMENT 

The area of validity of transforms should strictly contain the are of interest.

PARTIAL_INTERSECTION 

The area of validity of transforms should at least intersect the area of interest.

Member Function Documentation

CoordinateOperationContextNNPtr osgeo::proj::operation::CoordinateOperationContext::create ( const io::AuthorityFactoryPtr authorityFactory,
const metadata::ExtentPtr extent,
double  accuracy 
)
static

Creates a context for a coordinate operation.

If a non null authorityFactory is provided, the resulting context should not be used simultaneously by more than one thread.

Parameters
authorityFactoryAuthority factory, or null if no database lookup is allowed. Use io::authorityFactory::create(context, std::string()) to allow all authorities to be used.
extentArea of interest, or null if none is known.
accuracyMaximum allowed accuracy in metre, as specified in or 0 to get best accuracy.
Returns
a new context.
bool osgeo::proj::operation::CoordinateOperationContext::getAllowUseIntermediateCRS ( ) const

Return whether an intermediate pivot CRS can be used for researching coordinate operations between a source and target CRS.

Concretely if in the database there is an operation from A to C (or C to A), and another one from C to B (or B to C), but no direct operation between A and B, setting this parameter to true, allow chaining both operations.

The default is true.

CoordinateOperationContext::GridAvailabilityUse osgeo::proj::operation::CoordinateOperationContext::getGridAvailabilityUse ( ) const

Return how grid availability is used.

The default is USE_FOR_SORTING.

const std::vector< std::pair< std::string, std::string > > & osgeo::proj::operation::CoordinateOperationContext::getIntermediateCRS ( ) const

Return the potential pivot CRSs that can be used when trying to build a coordinate operation between two CRS that have no direct operation.

CoordinateOperationContext::SourceTargetCRSExtentUse osgeo::proj::operation::CoordinateOperationContext::getSourceAndTargetCRSExtentUse ( ) const

Return how source and target CRS extent should be used when considering if a transformation can be used (only takes effect if no area of interest is explicitly defined).

The default is CoordinateOperationContext::SourceTargetCRSExtentUse::SMALLEST.

CoordinateOperationContext::SpatialCriterion osgeo::proj::operation::CoordinateOperationContext::getSpatialCriterion ( ) const

Return the spatial criterion to use when comparing the area of validity of coordinate operations with the area of interest / area of validity of source and target CRS.

The default is STRICT_CONTAINMENT.

bool osgeo::proj::operation::CoordinateOperationContext::getUsePROJAlternativeGridNames ( ) const

Return whether PROJ alternative grid names should be substituted to the official authority names.

The default is true.

void osgeo::proj::operation::CoordinateOperationContext::setAllowUseIntermediateCRS ( bool  use)

Set whether an intermediate pivot CRS can be used for researching coordinate operations between a source and target CRS.

Concretely if in the database there is an operation from A to C (or C to A), and another one from C to B (or B to C), but no direct operation between A and B, setting this parameter to true, allow chaining both operations.

The current implementation is limited to researching one intermediate step.

By default, all potential C candidates will be used. setIntermediateCRS() can be used to restrict them.

The default is true.

void osgeo::proj::operation::CoordinateOperationContext::setGridAvailabilityUse ( GridAvailabilityUse  use)

Set how grid availability is used.

The default is USE_FOR_SORTING.

void osgeo::proj::operation::CoordinateOperationContext::setIntermediateCRS ( const std::vector< std::pair< std::string, std::string >> &  intermediateCRSAuthCodes)

Restrict the potential pivot CRSs that can be used when trying to build a coordinate operation between two CRS that have no direct operation.

Parameters
intermediateCRSAuthCodesa vector of (auth_name, code) that can be used as potential pivot RS
void osgeo::proj::operation::CoordinateOperationContext::setSourceAndTargetCRSExtentUse ( SourceTargetCRSExtentUse  use)

Set how source and target CRS extent should be used when considering if a transformation can be used (only takes effect if no area of interest is explicitly defined).

The default is CoordinateOperationContext::SourceTargetCRSExtentUse::SMALLEST.

void osgeo::proj::operation::CoordinateOperationContext::setSpatialCriterion ( SpatialCriterion  criterion)

Set the spatial criterion to use when comparing the area of validity of coordinate operations with the area of interest / area of validity of source and target CRS.

The default is STRICT_CONTAINMENT.

void osgeo::proj::operation::CoordinateOperationContext::setUsePROJAlternativeGridNames ( bool  usePROJNames)

Set whether PROJ alternative grid names should be substituted to the official authority names.

This only has effect is an authority factory with a non-null database context has been attached to this context.

If set to false, it is still possible to obtain later the substitution by using io::PROJStringFormatter::create() with a non-null database context.

The default is true.


The documentation for this class was generated from the following files: