MySQL 9.1.0
Source Code Documentation
|
#include "sql/gis/srs/srs.h"
#include <assert.h>
#include <stddef.h>
#include <cmath>
#include <map>
#include <memory>
#include <sstream>
#include <string>
#include <utility>
#include <vector>
#include <boost/variant/get.hpp>
#include "mysql/strings/dtoa.h"
#include "my_inttypes.h"
#include "my_sys.h"
#include "mysql/strings/m_ctype.h"
#include "mysqld_error.h"
#include "sql/gis/srs/wkt_parser.h"
Namespaces | |
namespace | gis |
namespace | gis::srs |
Functions | |
template<typename T > | |
static bool | has_no_conflicting_authority (const T &element, const char *name, int code) |
Check that an element doesn't have an authority clause with a different authority name and code. More... | |
template<typename T > | |
static bool | has_authority (const T &element, const char *name, int code) |
Check if an element has an authority clause with a given authority name and code. More... | |
static bool | set_parameters (gis::srid_t srid, gis::srs::wkt_parser::Projected_cs *proj, std::vector< std::pair< int, double * > > *params) |
Extract projection parameter values from the parse tree and assign them to variables. More... | |
static const char * | axis_direction_to_name (gis::srs::Axis_direction direction) |
void | push_fp_to_string (std::stringstream &proj4, const std::string &proj4_parameter, const double ¶meter) |
static bool | create_geographic_srs (gis::srid_t srid, gis::srs::wkt_parser::Geographic_cs *geog, gis::srs::Geographic_srs **srs) |
Create a geographic SRS description from a parse tree. More... | |
static gis::srs::Projected_srs * | new_projection (int epsg_code) |
Create a new projected SRS object based on EPSG code. More... | |
static bool | create_projected_srs (gis::srid_t srid, gis::srs::wkt_parser::Projected_cs *proj, gis::srs::Projected_srs **srs) |
Create a projected SRS description from a parse tree. More... | |
|
static |
|
static |
Create a geographic SRS description from a parse tree.
[in] | srid | Spatial reference system ID to use when reporting errors |
[in] | geog | Parser output |
[in,out] | srs | Geographic SRS object allocated by the caller |
true | An error has occurred |
false | Success |
|
static |
Create a projected SRS description from a parse tree.
[in] | srid | Spatial reference system ID to use when reporting errors |
[in] | proj | Parser output |
[out] | srs | A newly allocated projected SRS object |
true | An error has occurred |
false | Success |
|
static |
Check if an element has an authority clause with a given authority name and code.
The function will return true if the element has an authority clause which name matches (case insensitively) with the name parameter and a code which is the same as the code parameter.
T | The type of the element with the authority clause. |
element | The element with the authority clause. |
name | The authority name to check for. |
code | The authority code to check for. |
true | The element has the specified authority clause. |
false | The element doesn't have the specified authority clause. |
|
static |
Check that an element doesn't have an authority clause with a different authority name and code.
The function will return true if the element has no authority clause, or if it has an authority clause with a name that matches (case insensitively) with the name parameter and a code that is the same as the code parameter.
T | The type of the element with the authority clause. |
element | The element with the authority clause. |
name | The authority name to check for. |
code | The authority code to check for. |
true | The element has no other authority clause. |
false | The element has another authority clause. |
|
static |
Create a new projected SRS object based on EPSG code.
When creating a projected SRS object for a projection without an EPSG code, code 0 should be used.
If the EPSG code is 0 or unknown, an Unkown_projected_srs object is returned.
epsg_code | EPSG coordinate operation method (i.e. projection type) code |
void push_fp_to_string | ( | std::stringstream & | proj4, |
const std::string & | proj4_parameter, | ||
const double & | parameter | ||
) |
|
static |
Extract projection parameter values from the parse tree and assign them to variables.
The function is given a list of EPSG parameter codes for all parameters that can be extracted, and pointers to the variable where each parameter should be stored.
Mandatory parameters must be set to NAN before calling this function. Optional parameters must be set to their default value.
If a mandatory parameter is missing, an error is flagged and the function returns true.
[in] | srid | The spatial reference system ID, used in error reporting |
[in] | proj | Parse tree |
[in,out] | params | List of mandatory parameters (EPSG codes) and pointers to where their values should be stored. |
true | An error has occurred. The error has been flagged. |
false | Success |