MySQL 8.4.0
Source Code Documentation
item_geofunc_internal.h File Reference

This file defines common build blocks of GIS functions. More...

#include <stddef.h>
#include <boost/concept/usage.hpp>
#include <boost/geometry/core/cs.hpp>
#include <boost/geometry/core/tags.hpp>
#include <boost/geometry/geometries/box.hpp>
#include <boost/geometry/geometries/point.hpp>
#include <boost/geometry/geometries/segment.hpp>
#include <boost/geometry/index/rtree.hpp>
#include <cmath>
#include <utility>
#include <vector>
#include "sql/gis/srid.h"
#include "sql/gis_bg_traits.h"
#include "sql/item_geofunc.h"
#include "sql/spatial.h"

Go to the source code of this file.

Classes

class  BG_models< CoordinateSystemType >
 A wrapper and interface for all geometry types used here. More...
 
struct  bgpt_lt
 Less than comparator for points used by BG. More...
 
struct  bgpt_eq
 Equals comparator for points used by BG. More...
 

Macros

#define GIS_ZERO   0.00000000001
 

Typedefs

typedef bgm::point< double, 2, bgcs::cartesian > BG_point
 
typedef bgm::box< BG_pointBG_box
 
typedef std::pair< BG_box, size_t > BG_rtree_entry
 
typedef std::vector< BG_rtree_entryBG_rtree_entries
 
typedef bgi::rtree< BG_rtree_entry, bgi::quadratic< 64 > > Rtree_index
 
typedef std::vector< BG_rtree_entryRtree_result
 

Functions

void make_bg_box (const Geometry *g, BG_box *box)
 
bool is_box_valid (const BG_box &box)
 
void make_rtree (const BG_geometry_collection::Geometry_list &gl, Rtree_index *rtree)
 Build an rtree set using a geometry collection. More...
 
template<typename MultiGeometry >
void make_rtree_bggeom (const MultiGeometry &mg, Rtree_index *rtree)
 Build an rtree set using array of Boost.Geometry objects, which are components of a multi geometry. More...
 
Gis_geometry_collectionempty_collection (String *str, gis::srid_t srid)
 
bool is_empty_geocollection (const Geometry *g)
 
bool is_empty_geocollection (const String &wkbres)
 
template<typename BG_geotype >
bool post_fix_result (BG_result_buf_mgr *resbuf_mgr, BG_geotype &geout, String *res)
 For every Geometry object write-accessed by a boost geometry function, i.e. More...
 

Detailed Description

This file defines common build blocks of GIS functions.

Macro Definition Documentation

◆ GIS_ZERO

#define GIS_ZERO   0.00000000001

Typedef Documentation

◆ BG_box

typedef bgm::box<BG_point> BG_box

◆ BG_point

typedef bgm::point<double, 2, bgcs::cartesian> BG_point

◆ BG_rtree_entries

typedef std::vector<BG_rtree_entry> BG_rtree_entries

◆ BG_rtree_entry

typedef std::pair<BG_box, size_t> BG_rtree_entry

◆ Rtree_index

typedef bgi::rtree<BG_rtree_entry, bgi::quadratic<64> > Rtree_index

◆ Rtree_result

typedef std::vector<BG_rtree_entry> Rtree_result

Function Documentation

◆ empty_collection()

Gis_geometry_collection * empty_collection ( String str,
gis::srid_t  srid 
)
inline

◆ is_box_valid()

bool is_box_valid ( const BG_box box)
inline

◆ is_empty_geocollection() [1/2]

bool is_empty_geocollection ( const Geometry g)

◆ is_empty_geocollection() [2/2]

bool is_empty_geocollection ( const String wkbres)

◆ make_bg_box()

void make_bg_box ( const Geometry g,
BG_box box 
)
inline

◆ make_rtree()

void make_rtree ( const BG_geometry_collection::Geometry_list gl,
Rtree_index rtree 
)

Build an rtree set using a geometry collection.

Parameters
glgeometry object pointers container.
[out]rtreeentries which can be used to build an rtree.

◆ make_rtree_bggeom()

template<typename MultiGeometry >
void make_rtree_bggeom ( const MultiGeometry &  mg,
Rtree_index rtree 
)

Build an rtree set using array of Boost.Geometry objects, which are components of a multi geometry.

Parameters
mgthe multi geometry.
rtreethe rtree to build.

◆ post_fix_result()

template<typename BG_geotype >
bool post_fix_result ( BG_result_buf_mgr resbuf_mgr,
BG_geotype &  geout,
String res 
)

For every Geometry object write-accessed by a boost geometry function, i.e.

those passed as out parameter into set operation functions, call this function before using the result object's data.

Parameters
resbuf_mgrTracks the result buffer
[in,out]geoutGeometry object
[in,out]resGEOMETRY string.
Returns
true if an error occurred or if the geometry is an empty collection; false if no error occurred.