libcuproj  24.04.00
Loading...
Searching...
No Matches
Files | Functions
Projection Factory Functions

Factory functions to create coordinate projections. More...

Files

file  projection_factories.cuh
 

Functions

template<typename Coordinate , typename T = typename Coordinate::value_type>
projection< Coordinate > * cuproj::make_utm_projection (int zone, hemisphere hemisphere, direction dir=direction::FORWARD)
 Create a WGS84<-->UTM projection for the given UTM zone and hemisphere.
 
template<typename Coordinate >
cuproj::projection< Coordinate > * cuproj::make_projection (detail::epsg_code const &src_epsg, detail::epsg_code const &dst_epsg)
 Create a projection object from EPSG codes.
 
template<typename Coordinate >
cuproj::projection< Coordinate > * cuproj::make_projection (std::string const &src_epsg, std::string const &dst_epsg)
 Create a projection object from EPSG codes as "EPSG:XXXX" strings.
 
template<typename Coordinate >
cuproj::projection< Coordinate > * cuproj::make_projection (int src_epsg, int const &dst_epsg)
 Create a projection object from integer EPSG codes.
 

Detailed Description

Factory functions to create coordinate projections.

These factories make it easier to create projections from a variety of sources.

Function Documentation

◆ make_projection() [1/3]

template<typename Coordinate >
cuproj::projection< Coordinate > * cuproj::make_projection ( detail::epsg_code const & src_epsg,
detail::epsg_code const & dst_epsg )

Create a projection object from EPSG codes.

Exceptions
cuproj::logic_errorif the EPSG codes describe a transformation that is not supported
Note
Currently only WGS84 to UTM and UTM to WGS84 are supported, so one of the EPSG codes must be "EPSG:4326" (WGS84) and the other must be a UTM EPSG code.
Template Parameters
Coordinatethe coordinate type
Parameters
src_epsgthe source EPSG code
dst_epsgthe destination EPSG code
Returns
a unique_ptr to a projection object implementing the transformation between the two EPSG codes

Definition at line 128 of file projection_factories.cuh.

◆ make_projection() [2/3]

template<typename Coordinate >
cuproj::projection< Coordinate > * cuproj::make_projection ( int src_epsg,
int const & dst_epsg )

Create a projection object from integer EPSG codes.

Exceptions
cuproj::logic_errorif the EPSG codes describe a transformation that is not supported
Note
Currently only WGS84 to UTM and UTM to WGS84 are supported, so one of the EPSG codes must be 4326 (WGS84) and the other must be a UTM EPSG code.
Template Parameters
Coordinatethe coordinate type
Parameters
src_epsgthe source EPSG code
dst_epsgthe destination EPSG code
Returns
a pointer to a projection object implementing the transformation between the two EPSG codes

Definition at line 189 of file projection_factories.cuh.

◆ make_projection() [3/3]

template<typename Coordinate >
cuproj::projection< Coordinate > * cuproj::make_projection ( std::string const & src_epsg,
std::string const & dst_epsg )

Create a projection object from EPSG codes as "EPSG:XXXX" strings.

Exceptions
cuproj::logic_errorif the EPSG codes describe a transformation that is not supported
Note
Currently only WGS84 to UTM and UTM to WGS84 are supported, so one of the EPSG codes must be "EPSG:4326" (WGS84) and the other must be a UTM EPSG code.
Auth strings are case insensitive
Template Parameters
Coordinatethe coordinate type
Parameters
src_epsgthe source EPSG code
dst_epsgthe destination EPSG code
Returns
a pointer to a projection object implementing the transformation between the two EPSG codes

Definition at line 165 of file projection_factories.cuh.

◆ make_utm_projection()

template<typename Coordinate , typename T = typename Coordinate::value_type>
projection< Coordinate > * cuproj::make_utm_projection ( int zone,
hemisphere hemisphere,
direction dir = direction::FORWARD )

Create a WGS84<-->UTM projection for the given UTM zone and hemisphere.

Template Parameters
Coordinatethe coordinate type
Coordinate::value_typethe coordinate value type
Parameters
zonethe UTM zone
hemispherethe UTM hemisphere
dirif FORWARD, create a projection from UTM to WGS84, otherwise create a projection from WGS84 to UTM
Returns
a unique_ptr to a projection object implementing the requested transformation

Definition at line 96 of file projection_factories.cuh.