MySQL 8.0.39
Source Code Documentation
geometry_extraction.h File Reference

This file contains a few convenience functions for working with Geometries, to avoid boilerplate and mishandling of Geometries. More...

#include "my_sys.h"
#include "sql/dd/cache/dictionary_client.h"
#include "sql/gis/geometries.h"
#include "sql/sql_class.h"
#include <algorithm>
#include <memory>

Go to the source code of this file.

Classes

class  GeometryExtractionResult
 Type used to handle both the result of the decoding of a geometry and the geometry in the case of success. More...
 

Enumerations

enum class  ResultType { Error , NullValue , Value }
 Type used to differentiate the three cases that can happen when parsing a geometry. More...
 

Functions

template<typename FieldOrItem >
GeometryExtractionResult ExtractGeometry (FieldOrItem *fieldOrItem, THD *thd, const char *func_name)
 ExtractGeometry takes an Item or a Field, attempts to parse a geometry out of it and returns a value combining the result of the parsing process with the geometry in case it is a success. More...
 

Detailed Description

This file contains a few convenience functions for working with Geometries, to avoid boilerplate and mishandling of Geometries.

Enumeration Type Documentation

◆ ResultType

enum class ResultType
strong

Type used to differentiate the three cases that can happen when parsing a geometry.

Enumerator
Error 
NullValue 
Value 

Function Documentation

◆ ExtractGeometry()

template<typename FieldOrItem >
GeometryExtractionResult ExtractGeometry ( FieldOrItem *  fieldOrItem,
THD thd,
const char *  func_name 
)

ExtractGeometry takes an Item or a Field, attempts to parse a geometry out of it and returns a value combining the result of the parsing process with the geometry in case it is a success.

Parameters
[in]fieldOrItemThe Field or Item we want a geometry from.
[in]thdTHD* to report errors on
[in]func_nameC-string to report errors as.
Returns
GeometryExtractionResult which holds a result and an optional Geometry