OGR
Classes | Macros | Functions
ogr_spatialref.h File Reference
#include "cpl_string.h"
#include "ogr_srs_api.h"
#include <cstddef>
#include <map>
#include <memory>
#include <vector>

Go to the source code of this file.

Classes

class  OGR_SRSNode
 
struct  OGR_SRSNode::Listener
 
class  OGRSpatialReference
 
class  OGRCoordinateTransformation
 
struct  OGRCoordinateTransformationOptions
 

Macros

#define USGS_ANGLE_DECIMALDEGREES   0
 
#define USGS_ANGLE_PACKEDDMS   TRUE
 
#define USGS_ANGLE_RADIANS   2
 

Functions

OGRCoordinateTransformationOGRCreateCoordinateTransformation (const OGRSpatialReference *poSource, const OGRSpatialReference *poTarget)
 
OGRCoordinateTransformationOGRCreateCoordinateTransformation (const OGRSpatialReference *poSource, const OGRSpatialReference *poTarget, const OGRCoordinateTransformationOptions &options)
 

Detailed Description

Coordinate systems services.

Macro Definition Documentation

◆ USGS_ANGLE_DECIMALDEGREES

#define USGS_ANGLE_DECIMALDEGREES   0

Angle is in decimal degrees.

◆ USGS_ANGLE_PACKEDDMS

#define USGS_ANGLE_PACKEDDMS   TRUE

Angle is in packed degree minute second.

◆ USGS_ANGLE_RADIANS

#define USGS_ANGLE_RADIANS   2

Angle is in radians.

Function Documentation

◆ OGRCreateCoordinateTransformation() [1/2]

OGRCoordinateTransformation* OGRCreateCoordinateTransformation ( const OGRSpatialReference poSource,
const OGRSpatialReference poTarget 
)

Create transformation object.

This is the same as the C function OCTNewCoordinateTransformation().

Input spatial reference system objects are assigned by copy (calling clone() method) and no ownership transfer occurs.

The delete operator, or OCTDestroyCoordinateTransformation() should be used to destroy transformation objects.

This will honour the axis order advertized by the source and target SRS, as well as their "data axis to SRS axis mapping". To have a behaviour similar to GDAL < 3.0, the OGR_CT_FORCE_TRADITIONAL_GIS_ORDER configuration option can be set to YES.

Parameters
poSourcesource spatial reference system.
poTargettarget spatial reference system.
Returns
NULL on failure or a ready to use transformation object.

Referenced by OCTNewCoordinateTransformation(), OCTNewCoordinateTransformationEx(), and OGRGeometryFactory::transformWithOptions().

◆ OGRCreateCoordinateTransformation() [2/2]

OGRCoordinateTransformation* OGRCreateCoordinateTransformation ( const OGRSpatialReference poSource,
const OGRSpatialReference poTarget,
const OGRCoordinateTransformationOptions options 
)

Create transformation object.

This is the same as the C function OCTNewCoordinateTransformationEx().

Input spatial reference system objects are assigned by copy (calling clone() method) and no ownership transfer occurs.

The delete operator, or OCTDestroyCoordinateTransformation() should be used to destroy transformation objects.

This will honour the axis order advertized by the source and target SRS, as well as their "data axis to SRS axis mapping". To have a behaviour similar to GDAL < 3.0, the OGR_CT_FORCE_TRADITIONAL_GIS_ORDER configuration option can be set to YES.

The source SRS and target SRS should generally not be NULL. This is only allowed if a custom coordinate operation is set through the hOptions argument.

Starting with GDAL 3.0.3, the OGR_CT_OP_SELECTION configuration option can be set to PROJ (default if PROJ >= 6.3), BEST_ACCURACY or FIRST_MATCHING to decide of the strategy to select the operation to use among candidates, whose area of use is compatible with the points to transform. It is only taken into account if no user defined coordinate transformation pipeline has been specified.

  • PROJ means the default behaviour used by PROJ proj_create_crs_to_crs(). In particular the operation to use among several initial candidates is evaluated for each point to transform.
  • BEST_ACCURACY means the operation whose accuracy is best. It should be close to PROJ behaviour, except that the operation to select is decided for the average point of the coordinates passed in a single Transform() call.
  • FIRST_MATCHING is the operation ordered first in the list of candidates: it will not necessarily have the best accuracy, but generally a larger area of use. It is evaluated for the average point of the coordinates passed in a single Transform() call. This was the default behaviour for GDAL 3.0.0 to 3.0.2

If options contains a user defined coordinate transformation pipeline, it will be unconditionally used. If options has an area of interest defined, it will be used to research the best fitting coordinate transformation (which will be used for all coordinate transformations, even if they don't fall into the declared area of interest) If no options are set, then a list of candidate coordinate operations will be reseached, and at each call to Transform(), the best of those candidate regarding the centroid of the coordinate set will be dynamically selected.

Parameters
poSourcesource spatial reference system.
poTargettarget spatial reference system.
optionsCoordinate transformation options.
Returns
NULL on failure or a ready to use transformation object.
Since
GDAL 3.0

References OGRProjCT::Initialize().


Generated for GDAL by doxygen 1.8.17.