MySQL 9.1.0
Source Code Documentation
gis::srs::Geographic_srs Class Reference

A geographic (longitude-latitude) spatial reference system. More...

#include <srs.h>

Inheritance diagram for gis::srs::Geographic_srs:
[legend]

Public Member Functions

 Geographic_srs ()
 
Srs_type srs_type () const override
 Get the type of spatial reference system: projected, geometric, etc. More...
 
Spatial_reference_systemclone () override
 Clone the object. More...
 
virtual bool init (srid_t srid, wkt_parser::Geographic_cs *g)
 Initialize from parse tree. More...
 
bool has_towgs84 () const override
 Checks if this SRS has valid Bursa Wolf parameters. More...
 
bool is_wgs84_based () const override
 Checks if this SRS is WGS 84 or a projection based on WGS 84. More...
 
Axis_direction axis_direction (const int axis) const override
 Retrieve the axis direction of the spatial reference system. More...
 
std::string partial_proj4_parameters () const
 
double semi_major_axis () const
 
double inverse_flattening () const
 
double linear_unit () const override
 Retrieve how long the unit of the spatial reference system is in meters. More...
 
double angular_unit () const override
 Retrieve the angular unit relative to radians. More...
 
double prime_meridian () const override
 Retrieve the prime meridian relative to Greenwich. More...
 
bool can_be_modified_to (const Spatial_reference_system &srs) const override
 Checks if this SRS can be changed to another SRS without causing computational incompatibilities. More...
 
std::string proj4_parameters () const override
 Retrieve the proj4 parameter string. More...
 
- Public Member Functions inherited from gis::srs::Spatial_reference_system
 Spatial_reference_system ()=default
 
 Spatial_reference_system (const Spatial_reference_system &)=default
 
 Spatial_reference_system (Spatial_reference_system &&)=default
 
virtual ~Spatial_reference_system ()=default
 

Private Attributes

double m_semi_major_axis
 Semi-major axis of ellipsoid. More...
 
double m_inverse_flattening
 Inverse flattening of ellipsoid. More...
 
double m_towgs84 [7]
 Bursa Wolf transformation parameters used to transform to WGS84. More...
 
double m_prime_meridian
 Longitude of the prime meridian relative to the Greenwich Meridian (measured in m_angular_unit). More...
 
double m_angular_unit
 Conversion factor for the angular unit relative to radians. More...
 
Axis_direction m_axes [2]
 Direction of x and y axis, respectively. More...
 
bool m_is_wgs84
 Whether this SRS is WGS 84. More...
 

Detailed Description

A geographic (longitude-latitude) spatial reference system.

Constructor & Destructor Documentation

◆ Geographic_srs()

gis::srs::Geographic_srs::Geographic_srs ( )
inline

Member Function Documentation

◆ angular_unit()

double gis::srs::Geographic_srs::angular_unit ( ) const
inlineoverridevirtual

Retrieve the angular unit relative to radians.

Returns
Conversion factor.

Implements gis::srs::Spatial_reference_system.

◆ axis_direction()

Axis_direction gis::srs::Geographic_srs::axis_direction ( const int  axis) const
inlineoverridevirtual

Retrieve the axis direction of the spatial reference system.

Parameters
axisaxis number, zero indexed
Returns
Axis direction

Implements gis::srs::Spatial_reference_system.

◆ can_be_modified_to()

bool gis::srs::Geographic_srs::can_be_modified_to ( const Spatial_reference_system srs) const
overridevirtual

Checks if this SRS can be changed to another SRS without causing computational incompatibilities.

This means checking that all values in the two SRSs that affect computations are the same. The syntax of the SRS definitions may still vary, e.g., by using different names or by having different authority codes.

In some cases, e.g., unknown projection methods, we don't know how to compare the two SRSs. In that case, we fail by saying that the SRSs are not the same.

The operation is not commutative. The SRS parameter is allowed to have a TOWGS84 specification even though this object doesn't. The opposite is not necessarily true. If this object lacks TOWGS84 information, transformation operations are forbidden on this SRS. Adding that possibility changes what computations are available, but it doesn't change the result of any computation that can currently be done.

An SRS that is currently identified as WGS 84 may both add and remove TOWGS84 information as long as the parameters are all 0. Adding a non-all-zero TOWGS84 clause to a WGS 84 SRS is not allowed.

Parameters
srsThe SRS to compare with.
Return values
trueThe two SRSs are semantically the same.
falseThe two SRSs are semantically different, or we don't know how to compare them.

Implements gis::srs::Spatial_reference_system.

◆ clone()

Spatial_reference_system * gis::srs::Geographic_srs::clone ( )
inlineoverridevirtual

Clone the object.

Returns
A new Spatial_reference_system object

Implements gis::srs::Spatial_reference_system.

◆ has_towgs84()

bool gis::srs::Geographic_srs::has_towgs84 ( ) const
inlineoverridevirtual

Checks if this SRS has valid Bursa Wolf parameters.

Return values
trueTransformation parameters are specified.
falseTransformation parameters are not specified.

Implements gis::srs::Spatial_reference_system.

◆ init()

bool gis::srs::Geographic_srs::init ( gis::srid_t  srid,
wkt_parser::Geographic_cs g 
)
virtual

Initialize from parse tree.

Parameters
[in]sridSpatial reference system ID to use when reporting errors
[in]gParser output
Return values
trueAn error has occurred. The error has been flagged.
falseSuccess

◆ inverse_flattening()

double gis::srs::Geographic_srs::inverse_flattening ( ) const
inline

◆ is_wgs84_based()

bool gis::srs::Geographic_srs::is_wgs84_based ( ) const
inlineoverridevirtual

Checks if this SRS is WGS 84 or a projection based on WGS 84.

Return values
trueThis SRS is WGS 84 or a projection of WGS 84.
falseThis SRS is neither WGS 84 or a projection of WGS 84.

Implements gis::srs::Spatial_reference_system.

◆ linear_unit()

double gis::srs::Geographic_srs::linear_unit ( ) const
inlineoverridevirtual

Retrieve how long the unit of the spatial reference system is in meters.

Returns
Conversion factor

Implements gis::srs::Spatial_reference_system.

◆ partial_proj4_parameters()

std::string gis::srs::Geographic_srs::partial_proj4_parameters ( ) const

◆ prime_meridian()

double gis::srs::Geographic_srs::prime_meridian ( ) const
inlineoverridevirtual

Retrieve the prime meridian relative to Greenwich.

The prime meridian is returned in the angular unit of the SRS. Positive numbers are East of Greenwich.

See also
angular_unit
Returns
Prime meridian.

Implements gis::srs::Spatial_reference_system.

◆ proj4_parameters()

std::string gis::srs::Geographic_srs::proj4_parameters ( ) const
overridevirtual

Retrieve the proj4 parameter string.

If the SRS can't be represented as a proj4 parameter string, an empty string is returned.

Returns
Proj4 parameter string or empty string.

Reimplemented from gis::srs::Spatial_reference_system.

◆ semi_major_axis()

double gis::srs::Geographic_srs::semi_major_axis ( ) const
inline

◆ srs_type()

Srs_type gis::srs::Geographic_srs::srs_type ( ) const
inlineoverridevirtual

Get the type of spatial reference system: projected, geometric, etc.

Returns
SRS type

Implements gis::srs::Spatial_reference_system.

Member Data Documentation

◆ m_angular_unit

double gis::srs::Geographic_srs::m_angular_unit
private

Conversion factor for the angular unit relative to radians.

◆ m_axes

Axis_direction gis::srs::Geographic_srs::m_axes[2]
private

Direction of x and y axis, respectively.

◆ m_inverse_flattening

double gis::srs::Geographic_srs::m_inverse_flattening
private

Inverse flattening of ellipsoid.

◆ m_is_wgs84

bool gis::srs::Geographic_srs::m_is_wgs84
private

Whether this SRS is WGS 84.

◆ m_prime_meridian

double gis::srs::Geographic_srs::m_prime_meridian
private

Longitude of the prime meridian relative to the Greenwich Meridian (measured in m_angular_unit).

Positive values are East of Greenwich.

◆ m_semi_major_axis

double gis::srs::Geographic_srs::m_semi_major_axis
private

Semi-major axis of ellipsoid.

◆ m_towgs84

double gis::srs::Geographic_srs::m_towgs84[7]
private

Bursa Wolf transformation parameters used to transform to WGS84.


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