1#ifndef GEOFUNC_INTERNAL_INCLUDED
2#define GEOFUNC_INTERNAL_INCLUDED
35#include <boost/concept/usage.hpp>
36#include <boost/geometry/core/cs.hpp>
37#include <boost/geometry/core/tags.hpp>
38#include <boost/geometry/geometries/box.hpp>
39#include <boost/geometry/geometries/point.hpp>
40#include <boost/geometry/geometries/segment.hpp>
41#include <boost/geometry/index/rtree.hpp>
53#define GIS_ZERO 0.00000000001
59template <
typename CoordinateSystemType>
76namespace bgm = boost::geometry::model;
78namespace bgi = boost::geometry::index;
79namespace bgm = boost::geometry::model;
81typedef bgm::point<double, 2, bgcs::cartesian>
BG_point;
85typedef bgi::rtree<BG_rtree_entry, bgi::quadratic<64>>
Rtree_index;
91 box->min_corner().set<0>(mbr.
xmin);
92 box->min_corner().set<1>(mbr.
ymin);
93 box->max_corner().set<0>(mbr.
xmax);
94 box->max_corner().set<1>(mbr.
ymax);
98 return !(!std::isfinite(box.min_corner().get<0>()) ||
99 !std::isfinite(box.min_corner().get<1>()) ||
100 !std::isfinite(box.max_corner().get<0>()) ||
101 !std::isfinite(box.max_corner().get<1>()) ||
102 box.max_corner().get<0>() < box.min_corner().get<0>() ||
103 box.max_corner().get<1>() < box.min_corner().get<1>());
120template <
typename MultiGeometry>
155 template <
typename Po
int>
157 if (p1.template get<0>() != p2.template get<0>())
158 return p1.template get<0>() < p2.template get<0>();
160 return p1.template get<1>() < p2.template get<1>();
168 template <
typename Po
int>
170 return p1.template get<0>() == p2.template get<0>() &&
171 p1.template get<1>() == p2.template get<1>();
187template <
typename BG_geotype>
std::vector< Geometry * > Geometry_list
Definition: item_geofunc.h:150
A wrapper and interface for all geometry types used here.
Definition: item_geofunc_internal.h:60
Gis_multi_polygon Multipolygon
Definition: item_geofunc_internal.h:69
Gis_line_string Linestring
Definition: item_geofunc_internal.h:66
Gis_multi_point Multipoint
Definition: item_geofunc_internal.h:67
Gis_multi_line_string Multilinestring
Definition: item_geofunc_internal.h:68
Gis_polygon Polygon
Definition: item_geofunc_internal.h:65
double Coordinate_type
Definition: item_geofunc_internal.h:71
CoordinateSystemType Coordinate_system
Definition: item_geofunc_internal.h:72
Gis_point Point
Definition: item_geofunc_internal.h:62
We have to hold result buffers in functions that return a GEOMETRY string, because such a function's ...
Definition: item_geofunc.h:82
Definition: spatial.h:213
@ wkb_invalid_type
Definition: spatial.h:291
bool envelope(String *result) const
Definition: spatial.cc:958
Definition: spatial.h:2409
Definition: spatial.h:2099
Definition: spatial.h:2333
Definition: spatial.h:2290
Definition: spatial.h:2373
Definition: spatial.h:1152
Definition: spatial.h:2187
Using this class is fraught with peril, and you need to be very careful when doing so.
Definition: sql_string.h:167
bgi::rtree< BG_rtree_entry, bgi::quadratic< 64 > > Rtree_index
Definition: item_geofunc_internal.h:85
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.
Definition: geometry_rtree.cc:80
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.
Definition: item_geofunc_internal.cc:157
std::vector< BG_rtree_entry > Rtree_result
Definition: item_geofunc_internal.h:86
Gis_geometry_collection * empty_collection(String *str, gis::srid_t srid)
Definition: item_geofunc_internal.h:123
bgm::box< BG_point > BG_box
Definition: item_geofunc_internal.h:82
std::pair< BG_box, size_t > BG_rtree_entry
Definition: item_geofunc_internal.h:83
void make_rtree(const BG_geometry_collection::Geometry_list &gl, Rtree_index *rtree)
Build an rtree set using a geometry collection.
Definition: geometry_rtree.cc:55
bool is_box_valid(const BG_box &box)
Definition: item_geofunc_internal.h:97
std::vector< BG_rtree_entry > BG_rtree_entries
Definition: item_geofunc_internal.h:84
bool is_empty_geocollection(const Geometry *g)
Definition: item_geofunc_internal.cc:230
void make_bg_box(const Geometry *g, BG_box *box)
Definition: item_geofunc_internal.h:88
bgm::point< double, 2, bgcs::cartesian > BG_point
Definition: item_geofunc_internal.h:81
std::string str(const mysqlrouter::ConfigGenerator::Options::Endpoint &ep)
Definition: config_generator.cc:1081
Definition: item_geofunc.cc:102
Definition: box_traits.h:42
std::uint32_t srid_t
A spatial reference system ID (SRID).
Definition: srid.h:33
double xmin
Definition: spatial.h:84
double ymax
Definition: spatial.h:84
double xmax
Definition: spatial.h:84
double ymin
Definition: spatial.h:84
Equals comparator for points used by BG.
Definition: item_geofunc_internal.h:167
bool operator()(const Point &p1, const Point &p2) const
Definition: item_geofunc_internal.h:169
Less than comparator for points used by BG.
Definition: item_geofunc_internal.h:154
bool operator()(const Point &p1, const Point &p2) const
Definition: item_geofunc_internal.h:156