MySQL 8.0.39
Source Code Documentation
gis::Point Class Referenceabstract

A 2d point. More...

#include <geometries.h>

Inheritance diagram for gis::Point:
[legend]

Public Member Functions

 Point ()
 
 Point (double x, double y)
 
Geometry_type type () const override
 Gets the geometry type of the object. More...
 
bool accept (Geometry_visitor *v) override
 Applies a hierarchical visitor to this geometry. More...
 
bool is_empty () const override
 Check if this is an empty geometry. More...
 
Pointclone () const override=0
 
template<std::size_t K>
double get () const
 Gets a coordinate value. More...
 
double x () const
 Gets the first coordinate value. More...
 
double y () const
 Gets the second coordinate value. More...
 
template<std::size_t K>
void set (double d)
 Sets a coordinate. More...
 
void x (double d)
 Sets the first coordinate value. More...
 
void y (double d)
 Sets the second coordinate value. More...
 
template<>
double get () const
 
template<>
double get () const
 
template<>
void set (double d)
 
template<>
void set (double d)
 
- Public Member Functions inherited from gis::Geometry
 Geometry ()=default
 
virtual ~Geometry ()=default
 
 Geometry (const Geometry &)=default
 
Geometryoperator= (const Geometry &)=default
 
virtual Coordinate_system coordinate_system () const =0
 Gets the coordinate system. More...
 

Private Attributes

double m_x
 First coordinate (X or longitude). More...
 
double m_y
 Second coordinate (Y or latitude). More...
 

Detailed Description

A 2d point.

Point is an instantiable type in SQL.

Constructor & Destructor Documentation

◆ Point() [1/2]

gis::Point::Point ( )
inline

◆ Point() [2/2]

gis::Point::Point ( double  x,
double  y 
)
inline

Member Function Documentation

◆ accept()

bool gis::Point::accept ( Geometry_visitor v)
overridevirtual

Applies a hierarchical visitor to this geometry.

See also
gis::Geometry_visitor
Parameters
vA hierarchical visitor.
Return values
trueThe execution was aborted by the visitor.
falseThe execution completed.

Implements gis::Geometry.

◆ clone()

Point * gis::Point::clone ( ) const
overridepure virtual

Implements gis::Geometry.

Implemented in gis::Cartesian_point, and gis::Geographic_point.

◆ get() [1/3]

template<>
double gis::Point::get ( ) const

◆ get() [2/3]

template<>
double gis::Point::get ( ) const

◆ get() [3/3]

template<std::size_t K>
double gis::Point::get ( ) const

Gets a coordinate value.

This function signature must match the expectations of Boost.Geometry.

Template Parameters
KCoordinate number, zero indexed.
Returns
The coordinate value.

◆ is_empty()

bool gis::Point::is_empty ( ) const
inlineoverridevirtual

Check if this is an empty geometry.

The definition of empty geometries is the one in SFA-CA (OGC 06-103r4, Sect. 6.1.2.2), i.e., an empty point set.

Note
This is different from the function "empty", which returns true if a geometry contains no subgeometries. E.g., a geometry collection may contain another geometry collection which is empty. In this case, the "empty" function would return false on the outermost geometry collection, while "is_empty" would return true.
Return values
trueThe geometry represents the empty point set.
falseThe geometry represent a non-empty point set.

Implements gis::Geometry.

◆ set() [1/3]

template<>
void gis::Point::set ( double  d)

◆ set() [2/3]

template<>
void gis::Point::set ( double  d)

◆ set() [3/3]

template<std::size_t K>
void gis::Point::set ( double  d)

Sets a coordinate.

This function signature must match the expectations of Boost.Geometry.

Template Parameters
KCoordinate number, zero indexed.
Parameters
dThe coordinate value.

◆ type()

Geometry_type gis::Point::type ( ) const
inlineoverridevirtual

Gets the geometry type of the object.

Returns
The type of this object

Implements gis::Geometry.

◆ x() [1/2]

double gis::Point::x ( ) const

Gets the first coordinate value.

For geographic points, the first coordinate is longitude.

Returns
The first coordinate value.

◆ x() [2/2]

void gis::Point::x ( double  d)

Sets the first coordinate value.

For geographic points, the first coordinate is longitude.

Parameters
dThe coordinate value.

◆ y() [1/2]

double gis::Point::y ( ) const

Gets the second coordinate value.

For geographic points, the second coordinate is latitude.

Returns
The second coordinate value.

◆ y() [2/2]

void gis::Point::y ( double  d)

Sets the second coordinate value.

For geographic points, the second coordinate is latitude.

Parameters
dThe coordinate value.

Member Data Documentation

◆ m_x

double gis::Point::m_x
private

First coordinate (X or longitude).

Geographic coordinates are in radians, positive to the East of Greenwich. Cartesian coordinates are in the SRSs length unit.

◆ m_y

double gis::Point::m_y
private

Second coordinate (Y or latitude).

Geographic coordinates are in radians, positive to the North of the Equator. Cartesian coordinates are in the SRSs length unit.


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