GDAL
|
Coordinate systems services. More...
#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 |
Objects of this class are used to represent value nodes in the parsed representation of the WKT SRS format. More... | |
struct | OGR_SRSNode::Listener |
Listener that is notified of modification to nodes. More... | |
class | OGRSpatialReference |
This class represents an OpenGIS Spatial Reference System, and contains methods for converting between this object organization and well known text (WKT) format. More... | |
class | OGRCoordinateTransformation |
Interface for transforming between coordinate systems. More... | |
struct | OGRCoordinateTransformationOptions |
Context for coordinate transformation. More... | |
Macros | |
#define | USGS_ANGLE_DECIMALDEGREES 0 |
Angle is in decimal degrees. | |
#define | USGS_ANGLE_PACKEDDMS TRUE |
Angle is in packed degree minute second. | |
#define | USGS_ANGLE_RADIANS 2 |
Angle is in radians. | |
Functions | |
OGRCoordinateTransformation * | OGRCreateCoordinateTransformation (const OGRSpatialReference *poSource, const OGRSpatialReference *poTarget) |
Create transformation object. | |
OGRCoordinateTransformation * | OGRCreateCoordinateTransformation (const OGRSpatialReference *poSource, const OGRSpatialReference *poTarget, const OGRCoordinateTransformationOptions &options) |
Create transformation object. | |
Coordinate systems services.
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 behavior similar to GDAL < 3.0, the OGR_CT_FORCE_TRADITIONAL_GIS_ORDER configuration option can be set to YES.
poSource | source spatial reference system. |
poTarget | target spatial reference system. |
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 behavior 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.
By default, if the source or target SRS definition refers to an official CRS through a code, GDAL will use the official definition if the official definition and the source/target SRS definition are equivalent. Note that TOWGS84[] clauses are ignored when checking equivalence. Starting with GDAL 3.4.1, if you set the OGR_CT_PREFER_OFFICIAL_SRS_DEF configuration option to NO, the source or target SRS definition will be always used.
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 researched, and at each call to Transform(), the best of those candidate regarding the centroid of the coordinate set will be dynamically selected.
poSource | source spatial reference system. |
poTarget | target spatial reference system. |
options | Coordinate transformation options. |