PROJ C++ API
|
Context in which a coordinate operation is to be used. More...
#include <coordinateoperation.hpp>
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... | |
Context in which a coordinate operation is to be used.
Describe how grid availability is used.
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.
|
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.
authorityFactory | Authority factory, or null if no database lookup is allowed. Use io::authorityFactory::create(context, std::string()) to allow all authorities to be used. |
extent | Area of interest, or null if none is known. |
accuracy | Maximum allowed accuracy in metre, as specified in or 0 to get best accuracy. |
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.
intermediateCRSAuthCodes | a 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.