MySQL  8.0.22
Source Code Documentation
gis::Linestring Class Referenceabstract

A string of connected line segments. More...

#include <geometries.h>

Inheritance diagram for gis::Linestring:
gis::Curve gis::Geometry gis::Cartesian_linestring gis::Geographic_linestring gis::Linearring gis::Cartesian_linearring gis::Geographic_linearring gis::Cartesian_linearring gis::Geographic_linearring

Public Member Functions

Geometry_type type () const override
 Gets the geometry type of the object. More...
 
bool accept (Geometry_visitor *v) override=0
 Applies a hierarchical visitor to this geometry. More...
 
bool is_empty () const override
 Check if this is an empty geometry. More...
 
virtual void push_back (const Point &pt)=0
 Adds a point to the end of the linestring. More...
 
virtual void push_back (Point &&pt)=0
 
virtual bool empty () const =0
 Checks if the linestring is empty. More...
 
virtual std::size_t size () const =0
 Returns the size of (number of points in) the linestring. More...
 
virtual void clear () noexcept=0
 Removes all points from the linestring. More...
 
virtual Pointoperator[] (std::size_t i)=0
 
virtual const Pointoperator[] (std::size_t i) const =0
 
- 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...
 

Detailed Description

A string of connected line segments.

Linestring is an instantiable type in SQL.

According to the SFA-CA, linestrings have a linear interpolation between points. In MySQL, a linestring represents the geodesic. On a plane, this is linear interpolation, but on an ellipsoid, it's the shortest path along the ellipsoid surface.

Member Function Documentation

◆ accept()

bool gis::Linestring::accept ( Geometry_visitor v)
overridepure virtual

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::Curve.

Implemented in gis::Linearring, gis::Geographic_linearring, gis::Cartesian_linearring, gis::Geographic_linestring, and gis::Cartesian_linestring.

◆ clear()

virtual void gis::Linestring::clear ( )
pure virtualnoexcept

Removes all points from the linestring.

Implemented in gis::Geographic_linearring, gis::Cartesian_linearring, gis::Geographic_linestring, and gis::Cartesian_linestring.

◆ empty()

virtual bool gis::Linestring::empty ( ) const
pure virtual

Checks if the linestring is empty.

Here, the definition of empty is that the linestring does not contain any points. An invalid linestring with only one coordinate is not empty.

Return values
trueThe linestring is empty.
falseThe linestring is not empty.

Implemented in gis::Geographic_linearring, gis::Cartesian_linearring, gis::Geographic_linestring, and gis::Cartesian_linestring.

◆ is_empty()

bool gis::Linestring::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.

Reimplemented in gis::Geographic_linearring, and gis::Cartesian_linearring.

◆ operator[]() [1/2]

virtual Point& gis::Linestring::operator[] ( std::size_t  i)
pure virtual

◆ operator[]() [2/2]

virtual const Point& gis::Linestring::operator[] ( std::size_t  i) const
pure virtual

◆ push_back() [1/2]

virtual void gis::Linestring::push_back ( const Point pt)
pure virtual

Adds a point to the end of the linestring.

Parameters
ptThe point to add.

Implemented in gis::Geographic_linearring, gis::Cartesian_linearring, gis::Geographic_linestring, and gis::Cartesian_linestring.

◆ push_back() [2/2]

virtual void gis::Linestring::push_back ( Point &&  pt)
pure virtual

◆ size()

virtual std::size_t gis::Linestring::size ( ) const
pure virtual

Returns the size of (number of points in) the linestring.

Returns
Number of points in the linestring.

Implemented in gis::Geographic_linearring, gis::Cartesian_linearring, gis::Geographic_linestring, and gis::Cartesian_linestring.

◆ type()

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

Gets the geometry type of the object.

Returns
The type of this object

Implements gis::Curve.

Reimplemented in gis::Geographic_linearring, and gis::Cartesian_linearring.


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