![]() |
MySQL
8.0.23
Source Code Documentation
|
Namespaces | |
srs | |
Classes | |
class | Area |
Area functor that calls boost::geometry::area with the correct parameter types. More... | |
class | Box |
A 2d box with sides parallel to the coordinate system grid. More... | |
class | Cartesian_box |
A Cartesian 2d box. More... | |
class | Cartesian_geometrycollection |
A Cartesian 2d geometry collection. More... | |
class | Cartesian_linearring |
A Cartesian 2d linear ring. More... | |
class | Cartesian_linestring |
A Cartesian 2d linestring. More... | |
class | Cartesian_multilinestring |
A Cartesian 2d multilinestring. More... | |
class | Cartesian_multipoint |
A Cartesian 2d multipoint. More... | |
class | Cartesian_multipolygon |
A Cartesian 2d multipolygon. More... | |
class | Cartesian_point |
A Cartesian 2d point. More... | |
class | Cartesian_polygon |
A Cartesian 2d polygon. More... | |
class | Coordinate_range_visitor |
A visitor that checks if coordinates are within range for a spatial reference system. More... | |
class | Covered_by |
Covered_by functor that calls Boost.Geometry with the correct parameter types. More... | |
class | Crosses |
Crosses functor that calls Boost.Geometry with the correct parameter types. More... | |
class | Curve |
An abstract 2d curve. More... | |
class | Difference |
Difference functor that calls Boost.Geometry with the correct parameter types. More... | |
class | Disjoint |
Disjoint functor that calls Boost.Geometry with the correct parameter types. More... | |
class | Distance |
Distance functor that calls Boost.Geometry with the correct parameter types. More... | |
class | Distance_sphere |
Functor that calls Boost.Geometry with the correct parameter types. More... | |
class | Equals |
Equals functor that calls Boost.Geometry with the correct parameter types. More... | |
class | Frechet_distance |
Frechet_distance functor that calls Boost.Geometry with the correct parameter types. More... | |
class | Functor |
The base class of all functors that takes two geometry arguments. More... | |
class | Geographic_box |
A Geographic 2d box. More... | |
class | Geographic_geometrycollection |
A geographic (ellipsoidal) 2d geometry collection. More... | |
class | Geographic_linearring |
A geographic (ellipsoidal) 2d linear ring. More... | |
class | Geographic_linestring |
A geographic (ellipsoidal) 2d linestring. More... | |
class | Geographic_multilinestring |
A geographic (ellipsoidal) 2d multilinestring. More... | |
class | Geographic_multipoint |
A geographic (ellipsoidal) 2d multipoint. More... | |
class | Geographic_multipolygon |
A geographic (ellipsoidal) 2d multipolygon. More... | |
class | Geographic_point |
A geographic (ellipsoidal) 2d point. More... | |
class | Geographic_polygon |
A geographic (ellipsoidal) 2d polygon. More... | |
class | Geometry |
Abstract superclass for all geometric objects. More... | |
class | Geometry_visitor |
Abstract visitor class to be used on class Geometry and descendants. More... | |
class | Geometrycollection |
A collection of geometries. More... | |
class | Hausdorff_distance |
HausdorffDistance functor that calls Boost.Geometry with the correct parameter types. More... | |
class | Intersects |
Intersects functor that calls Boost.Geometry with the correct parameter types. More... | |
class | invalid_geometry_exception |
Invalid geometry exception. More... | |
class | Is_simple |
Is_simple functor calls boost::geometry::is_simple with the correct parameter types. More... | |
class | Is_valid |
struct | latitude_out_of_range_exception |
Latitude out of range exception. More... | |
class | Length |
Length functor that calls Boost.Geometry with the correct parameter types. More... | |
class | Linearring |
A ring-shaped linestring. More... | |
class | Linestring |
A string of connected line segments. More... | |
struct | longitude_out_of_range_exception |
Longitude out of range exception. More... | |
class | Multicurve |
An abstract collection of curves. More... | |
class | Multilinestring |
A colletion of linestrings. More... | |
class | Multipoint |
A collection of points. More... | |
class | Multipolygon |
A collection of polygons. More... | |
class | Multisurface |
An abstract collection of surfaces. More... | |
class | Nop_visitor |
A visitor that implements the entire interface and does nothing. More... | |
class | not_implemented_exception |
Function/parameter combination not implemented exception. More... | |
class | null_value_exception |
NULL value exception. More... | |
class | Overlaps |
Overlaps functor that calls Boost.Geometry with the correct parameter types. More... | |
class | Point |
A 2d point. More... | |
class | Polygon |
A polygon consisting of an outer ring and zero or more interior rings defining holes in the polygon. More... | |
class | Ring_flip_visitor |
A visitor that flips polygon rings so that exterior rings are in a counter-clockwise direction and interior rings in a clockwise direction. More... | |
class | Simplify |
Simplify functor that calls Boost.Geometry with the correct parameter types. More... | |
class | Surface |
An abstract 2d surface. More... | |
class | too_large_polygon_exception |
Too large polygon exception. More... | |
class | Touches |
Touches functor that calls Boost.Geometry with the correct parameter types. More... | |
class | Transform |
Transform functor that calls Boost.Geometry with the correct parameter types. More... | |
class | Unary_functor |
The base class of all functors that take one geometry argument. More... | |
class | Union |
Union functor that calls Boost.Geometry with the correct parameter types. More... | |
struct | Unit |
class | Within |
Within functor that calls Boost.Geometry with the correct parameter types. More... | |
class | Wkb_parser |
class | Wkb_size_visitor |
A visitor that computes the size of a WKB representation of a geometry. More... | |
class | Wkb_visitor |
A visitor that serializes the geometry to little-endian WKB and appends it to a string. More... | |
Typedefs | |
typedef std::uint32_t | srid_t |
A spatial reference system ID (SRID). More... | |
Enumerations | |
enum | Geometry_type : std::uint32_t { Geometry_type::kGeometry = 0, Geometry_type::kPoint = 1, Geometry_type::kLinestring = 2, Geometry_type::kPolygon = 3, Geometry_type::kMultipoint = 4, Geometry_type::kMultilinestring = 5, Geometry_type::kMultipolygon = 6, Geometry_type::kGeometrycollection = 7 } |
Types of geometry objects. More... | |
enum | Coordinate_system { Coordinate_system::kCartesian = 0, Coordinate_system::kGeographic = 1 } |
Types of coordinate systems. More... | |
enum | Ring_direction { Ring_direction::kCW = 0, Ring_direction::kCCW = 1, Ring_direction::kUnknown = 2 } |
Direction of a ring. More... | |
enum | Unit_Type { Unit_Type::kLinear } |
enum | Byte_order : std::uint8_t { Byte_order::XDR = 0, Byte_order::NDR = 1 } |
WKB endianness. More... | |
Functions | |
bool | area (const dd::Spatial_reference_system *srs, const Geometry *g, const char *func_name, double *result, bool *result_null) noexcept |
bool | mbr_covered_by (const dd::Spatial_reference_system *srs, const Geometry *g1, const Geometry *g2, const char *func_name, bool *covered_by, bool *null) noexcept |
Computes the covered by relation between the minimum bounding rectangles of two geometries. More... | |
template<typename GC > | |
static bool | geometry_collection_apply_crosses (const Crosses &f, const Geometry *g1, const Geometry *g2) |
Apply a Crosses functor to two geometries, which both may be geometry collections, and return the booelan result of the functor applied on each combination of elements in the collections. More... | |
bool | crosses (const dd::Spatial_reference_system *srs, const Geometry *g1, const Geometry *g2, const char *func_name, bool *crosses, bool *null) noexcept |
Computes the crosses relation between two geometries. More... | |
template<typename GC > | |
static bool | geometry_collection_apply_disjoint (const Disjoint &f, const Geometry *g1, const Geometry *g2) |
Apply a Disjoint functor to two geometries, which both may be geometry collections, and return the boolean result of the functor applied on each combination of elements in the collections. More... | |
bool | disjoint (const dd::Spatial_reference_system *srs, const Geometry *g1, const Geometry *g2, const char *func_name, bool *disjoint, bool *null) noexcept |
Computes the disjoint relation between two geometries. More... | |
bool | mbr_disjoint (const dd::Spatial_reference_system *srs, const Geometry *g1, const Geometry *g2, const char *func_name, bool *disjoint, bool *null) noexcept |
Computes the disjoint relation between the minimum bounding rectangles of two geometries. More... | |
bool | distance (const dd::Spatial_reference_system *srs, const Geometry *g1, const Geometry *g2, double *distance, bool *is_null) noexcept |
Computes the distance between two geometries. More... | |
template<typename GC > | |
static double | geometry_collection_apply_min (const Functor< double > *f, const Geometry *g1, const Geometry *g2) |
Apply a Functor<double> to two geometries, which both may be geometry collections, and return the minimum result of the functor applied on each combination of elements in the collections. More... | |
static Geographic_point | reinterpret_as_degrees (const Cartesian_point &g) |
Map Cartesian geometry to geographic, mapping degrees east = x, degrees north = y. More... | |
static Geographic_multipoint | reinterpret_as_degrees (const Cartesian_multipoint &g) |
Map Cartesian geometry to geographic, mapping degrees east = x, degrees north = y. More... | |
bool | distance_sphere (const dd::Spatial_reference_system *srs, const Geometry *g1, const Geometry *g2, const char *func_name, double sphere_radius, double *result, bool *result_null) noexcept |
Compute the approximate distance between two geometries by assuming the world is a sphere. More... | |
template<typename GC > | |
static bool | geometry_collection_apply_equals (const Equals &f, const Geometry *g1, const Geometry *g2) |
Apply an Equals functor to two geometries, which both may be geometry collections, and return the boolean result of the functor applied on each combination of elements in the collections. More... | |
bool | equals (const dd::Spatial_reference_system *srs, const Geometry *g1, const Geometry *g2, const char *func_name, bool *equals, bool *null) noexcept |
Computes the equals relation between two geometries. More... | |
bool | mbr_equals (const dd::Spatial_reference_system *srs, const Geometry *g1, const Geometry *g2, const char *func_name, bool *equals, bool *null) noexcept |
Computes the equals relation between the minimum bounding rectangles of two geometries. More... | |
bool | frechet_distance (const dd::Spatial_reference_system *srs, const Geometry *g1, const Geometry *g2, const char *func_name, double *frechet_distance, bool *null) noexcept |
Computes the discrete Frechet distance between linestrings. More... | |
template<typename Pt , typename Ls , typename Py , typename GC , typename MPt , typename MLs , typename MPy > | |
static void | typed_split_gc (const GC *gc, MPt *mpt, MLs *mls, MPy *mpy) |
void | split_gc (const Geometrycollection *gc, std::unique_ptr< Multipoint > *mpt, std::unique_ptr< Multilinestring > *mls, std::unique_ptr< Multipolygon > *mpy) |
Splits a geometrycollection into points, linestrings and polygons. More... | |
template<typename MPt , typename MLs , typename MPy > | |
void | typed_gc_union (double semi_major, double semi_minor, std::unique_ptr< Multipoint > *mpt, std::unique_ptr< Multilinestring > *mls, std::unique_ptr< Multipolygon > *mpy) |
void | gc_union (double semi_major, double semi_minor, std::unique_ptr< Multipoint > *mpt, std::unique_ptr< Multilinestring > *mls, std::unique_ptr< Multipolygon > *mpy) |
Cleans up overlapping geometries so that the geometrycollection is broken down into non-overlapping collections. More... | |
const char * | type_to_name (Geometry_type type) |
Get the type name string corresponding to a geometry type. More... | |
bool | operator< (const Point &lhs, const Point &rhs) |
Compares two points. More... | |
bool | hausdorff_distance (const dd::Spatial_reference_system *srs, const Geometry *g1, const Geometry *g2, const char *func_name, double *hausdorff_distance, bool *null) noexcept |
Computes the discrete hausdorff distance between linestrings. More... | |
template<typename GC > | |
static bool | geometry_collection_apply_intersects (const Intersects &f, const Geometry *g1, const Geometry *g2) |
Apply an Intersects functor to two geometries, which both may be geometry collections, and return the booelan result of the functor applied on each combination of elements in the collections. More... | |
bool | intersects (const dd::Spatial_reference_system *srs, const Geometry *g1, const Geometry *g2, const char *func_name, bool *intersects, bool *null) noexcept |
Computes the intersects relation between two geometries. More... | |
bool | mbr_intersects (const dd::Spatial_reference_system *srs, const Geometry *g1, const Geometry *g2, const char *func_name, bool *intersects, bool *null) noexcept |
Computes the intersects relation between the minimum bounding rectangles of two geometries. More... | |
bool | is_simple (const dd::Spatial_reference_system *srs, const Geometry *g, const char *func_name, bool *result, bool *result_null) noexcept |
Test whether geometry is geometrically simple. More... | |
bool | is_valid (const dd::Spatial_reference_system *srs, const Geometry *g, const char *func_name, bool *is_valid) noexcept |
Decides if a geometry is valid. More... | |
bool | length (const dd::Spatial_reference_system *srs, const Geometry *g1, double *distance, bool *null) noexcept |
Computes the length of linestrings and multilinestrings. More... | |
bool | mbrs_are_equal (Box const &mbr1, Box const &mbr2) |
Checks if two MBRs are equal. More... | |
bool | mbr_is_empty (Box const &mbr) |
Checks if an MBR is empty. More... | |
bool | mbr_is_point (Box const &mbr) |
Checks if an MBR represents a point. More... | |
bool | mbr_is_line (Box const &mbr) |
Checks if an MBR represents a line. More... | |
static void | merge_mbrs (const std::vector< Cartesian_box > &boxes, Cartesian_box *mbr) |
Merges a vector of Cartesian MBRs into one common MBR. More... | |
static void | merge_mbrs (const std::vector< Geographic_box > &boxes, Geographic_box *mbr) |
Merges a vector of geographic MBRs into one common MBR. More... | |
static void | cartesian_envelope (const Geometry *g, Cartesian_box *mbr) |
Computes the envelope of a Cartesian geometry. More... | |
static void | geographic_envelope (const Geometry *g, double semi_major, double semi_minor, Geographic_box *mbr) |
Computes the envelope of a geographic geometry. More... | |
void | box_envelope (const Geometry *g, const dd::Spatial_reference_system *srs, Box *mbr) |
Computes the envelope of a geometry. More... | |
template<typename GC > | |
static bool | geometry_collection_apply_overlaps (const Overlaps &f, const Geometry *g1, const Geometry *g2) |
Apply an Overlaps functor to two geometries, which both may be geometry collections, and return the booelan result of the functor applied on each combination of elements in the collections. More... | |
bool | overlaps (const dd::Spatial_reference_system *srs, const Geometry *g1, const Geometry *g2, const char *func_name, bool *overlaps, bool *null) noexcept |
Computes the overlaps relation between two geometries. More... | |
bool | mbr_overlaps (const dd::Spatial_reference_system *srs, const Geometry *g1, const Geometry *g2, const char *func_name, bool *overlaps, bool *null) noexcept |
Computes the overlaps relation between the minimum bounding rectangles of two geometries. More... | |
bool | mbr_touches (const dd::Spatial_reference_system *srs, const Geometry *g1, const Geometry *g2, const char *func_name, bool *touches, bool *null) noexcept |
Computes the touches relation between the minimum bounding rectangles of two geometries. More... | |
bool | mbr_within (const dd::Spatial_reference_system *srs, const Geometry *g1, const Geometry *g2, const char *func_name, bool *within, bool *null) noexcept |
Computes the within relation between the minimum bounding rectangles of two geometries. More... | |
bool | touches (const dd::Spatial_reference_system *srs, const Geometry *g1, const Geometry *g2, const char *func_name, bool *touches, bool *null) noexcept |
Computes the touches relation between two geometries. More... | |
bool | within (const dd::Spatial_reference_system *srs, const Geometry *g1, const Geometry *g2, const char *func_name, bool *within, bool *null) noexcept |
Computes the within relation between two geometries. More... | |
bool | simplify (const dd::Spatial_reference_system *srs, const Geometry &g, double max_distance, const char *func_name, std::unique_ptr< Geometry > *result) noexcept |
Simplifies a geometry using the Douglas-Peucker algorithm. More... | |
collation_unordered_map< std::string, Unit > | units () |
A function to obtaint the supported units for the gis module. More... | |
bool | get_conversion_factor (const std::string &unit, double *conversion_factor) |
Retrieves the length of the unit in meters. More... | |
template<typename GC > | |
static bool | geometry_collection_apply_touches (const Touches &f, const Geometry *g1, const Geometry *g2) |
Apply a Touches functor to two geometries, which both may be geometry collections, and return the booelan result of the functor applied on each combination of elements in the collections. More... | |
bool | transform (const dd::Spatial_reference_system *source_srs, const Geometry &in, const dd::Spatial_reference_system *target_srs, const char *func_name, std::unique_ptr< Geometry > *out) noexcept |
Transforms a geometry from one SRS to another. More... | |
static bool | is_valid_type (Geometry_type type) |
Checks if a given type is a valid (and supported) WKB type. More... | |
static bool | is_subtype_of (Geometry_type sub, Geometry_type super) |
Checks if a given type is a subtype of a given supertype. More... | |
static bool | is_valid_type_or_subtype (Geometry_type sub, Geometry_type super) |
Checks if a given type is a valid type and that it is a subtype of a given supertype. More... | |
std::unique_ptr< Geometry > | parse_wkb (THD *thd, const dd::Spatial_reference_system *srs, const char *wkb, std::size_t length, bool ignore_axis_order=false) |
Parses a geometry WKB string and constructs a geometry object. More... | |
bool | parse_srid (const char *str, std::size_t length, srid_t *srid) |
Parses an SRID from a little-endian string. More... | |
bool | parse_geometry (THD *thd, const char *func_name, const String *str, const dd::Spatial_reference_system **srs, std::unique_ptr< Geometry > *geometry, bool treat_unknown_srid_as_cartesian=false) |
Parses a little-endian geometry string (SRID + WKB). More... | |
bool | write_geometry (const dd::Spatial_reference_system *srs, Geometry &geometry, String *str) |
Writes a little-endian geometry string (SRID + WKB). More... | |
typedef std::uint32_t gis::srid_t |
A spatial reference system ID (SRID).
This type matches the SRID storage format in MySQL.
|
strong |
|
strong |
|
strong |
|
strong |
|
strong |
|
noexcept |
void gis::box_envelope | ( | const Geometry * | g, |
const dd::Spatial_reference_system * | srs, | ||
Box * | mbr | ||
) |
Computes the envelope of a geometry.
The result may be a collapsed MBR.
[in] | g | The geometry. |
[in] | srs | The spatial reference system of the geometry. |
[out] | mbr | The envelope. |
|
static |
Computes the envelope of a Cartesian geometry.
The MBR returned may be a collapsed box.
[in] | g | The geometry. |
[out] | mbr | The envelope of g. |
|
noexcept |
Computes the crosses relation between two geometries.
Both geometries must be in the same coordinate system (Cartesian or geographic), and the coordinate system of the geometries must match the coordinate system of the SRID. It is the caller's responsibility to guarantee this.
[in] | srs | The spatial reference system, common to both geometries. |
[in] | g1 | First geometry. |
[in] | g2 | Second geometry. |
[in] | func_name | Function name used in error reporting. |
[out] | crosses | Whether g1 crosses g2. |
[out] | null | True if the return value is NULL. |
false | Success. |
true | An error has occurred. The error has been reported with my_error(). |
|
noexcept |
Computes the disjoint relation between two geometries.
Both geometries must be in the same coordinate system (Cartesian or geographic), and the coordinate system of the geometries must match the coordinate system of the SRID. It is the caller's responsibility to guarantee this.
[in] | srs | The spatial reference system, common to both geometries. |
[in] | g1 | First geometry. |
[in] | g2 | Second geometry. |
[in] | func_name | Function name used in error reporting. |
[out] | disjoint | Whether g1 is disjoint from g2. |
[out] | null | True if the return value is NULL. |
false | Success. |
true | An error has occurred. The error has been reported with my_error(). |
|
noexcept |
Computes the distance between two geometries.
Both geometries must be in the same coordinate system (Cartesian or geographic), and the coordinate system of the geometries must match the coordinate system of the SRID. It is the caller's responsibility to guarantee this.
[in] | srs | The spatial reference system, common to both geometries. |
[in] | g1 | First geometry. |
[in] | g2 | Second geometry. |
[out] | distance | The shortest distance between g1 and g2 in the SRS' linear unit. |
[out] | is_null | True if the return value is NULL. |
false | Success. |
true | An error has occurred. The error has been reported with my_error(). |
|
noexcept |
Compute the approximate distance between two geometries by assuming the world is a sphere.
The coordinate system of the geometries must match the coordinate system of the SRID. It is the caller's responsibility to guarantee this.
[in] | srs | The spatial reference system. |
[in] | g1 | Geometry 1. |
[in] | g2 | Geometry 2. |
[in] | func_name | Function name used in error reporting. |
[in] | sphere_radius | Radius of sphere. |
[out] | result | Distance between g1 and g2. Invalid if result_null . |
[out] | result_null | Whether return value is NULL instead of result . |
false | Success. |
true | An error has occurred. The error has been reported with my_error(). |
|
noexcept |
Computes the equals relation between two geometries.
Both geometries must be in the same coordinate system (Cartesian or geographic), and the coordinate system of the geometries must match the coordinate system of the SRID. It is the caller's responsibility to guarantee this.
[in] | srs | The spatial reference system, common to both geometries. |
[in] | g1 | First geometry. |
[in] | g2 | Second geometry. |
[in] | func_name | Function name used in error reporting. |
[out] | equals | Whether g1 equals g2. |
[out] | null | True if the return value is NULL. |
false | Success. |
true | An error has occurred. The error has been reported with my_error(). |
|
noexcept |
Computes the discrete Frechet distance between linestrings.
[in] | srs | The spatial reference system, common to both geometries. |
[in] | g1 | First geometry. |
[in] | g2 | Second geometry. |
[in] | func_name | Function name used in error reporting. |
[out] | frechet_distance | The Frechet distance between g1 and g2 in the SRS' linear unit. |
[out] | null | True if the return value is NULL. |
false | Success. |
true | An error has occurred. The error has been reported with my_error(). |
void gis::gc_union | ( | double | semi_major, |
double | semi_minor, | ||
std::unique_ptr< Multipoint > * | mpt, | ||
std::unique_ptr< Multilinestring > * | mls, | ||
std::unique_ptr< Multipolygon > * | mpy | ||
) |
Cleans up overlapping geometries so that the geometrycollection is broken down into non-overlapping collections.
All input collections may contain overlapping geometries and duplicates, including the multipolygon. This function requires that at least one of the inputs must be non-empty.
May throw exceptions from BG operations.
[in] | semi_major | Semi-major axis of ellipsoid. |
[in] | semi_minor | Semi-minor axis of ellipsoid. |
[in,out] | mpt | All points in the geometrycollection. |
[in,out] | mls | All linestrings in the geometrycollection. |
[in,out] | mpy | All polygons in the geometrycollection. |
|
static |
Computes the envelope of a geographic geometry.
The MBR returned may be a collapsed box.
[in] | g | The geometry. |
[in] | semi_major | Semi-major axis of ellipsoid. |
[in] | semi_minor | Semi-minor axis of ellipsoid. |
[out] | mbr | The envelope of g. |
|
static |
Apply a Crosses functor to two geometries, which both may be geometry collections, and return the booelan result of the functor applied on each combination of elements in the collections.
GC | Coordinate specific gometry collection type. |
f | Functor to apply. |
g1 | First geometry. |
g2 | Second geometry. |
true | g1 crosses g2. |
false | g1 doesn't cross g2. |
|
static |
Apply a Disjoint functor to two geometries, which both may be geometry collections, and return the boolean result of the functor applied on each combination of elements in the collections.
GC | Coordinate specific gometry collection type. |
f | Functor to apply. |
g1 | First geometry. |
g2 | Second geometry. |
true | g1 is disjoint from g2. |
false | g1 isn't disjoint from g2. |
|
static |
Apply an Equals functor to two geometries, which both may be geometry collections, and return the boolean result of the functor applied on each combination of elements in the collections.
GC | Coordinate specific gometry collection type. |
f | Functor to apply. |
g1 | First geometry. |
g2 | Second geometry. |
true | g1 equals g2. |
false | g1 doesn't equal g2. |
|
static |
Apply an Intersects functor to two geometries, which both may be geometry collections, and return the booelan result of the functor applied on each combination of elements in the collections.
GC | Coordinate specific gometry collection type. |
f | Functor to apply. |
g1 | First geometry. |
g2 | Second geometry. |
true | g1 intersects g2. |
false | g1 doesn't intersect g2. |
|
static |
Apply a Functor<double> to two geometries, which both may be geometry collections, and return the minimum result of the functor applied on each combination of elements in the collections.
GC | Coordinate specific gometry collection type. |
f | Functor to apply. |
g1 | First geometry. |
g2 | Second geometry. |
|
static |
Apply an Overlaps functor to two geometries, which both may be geometry collections, and return the booelan result of the functor applied on each combination of elements in the collections.
GC | Coordinate specific gometry collection type. |
f | Functor to apply. |
g1 | First geometry. |
g2 | Second geometry. |
true | g1 overlaps g2. |
false | g1 doesn't overlap g2. |
|
static |
Apply a Touches functor to two geometries, which both may be geometry collections, and return the booelan result of the functor applied on each combination of elements in the collections.
GC | Coordinate specific gometry collection type. |
f | Functor to apply. |
g1 | First geometry. |
g2 | Second geometry. |
true | g1 touches g2. |
false | g1 doesn't touch g2. |
bool gis::get_conversion_factor | ( | const std::string & | unit, |
double * | conversion_factor | ||
) |
Retrieves the length of the unit in meters.
unit | the name of the unit we want the conversion factor for. | |
[out] | conversion_factor | A pointer to where the result should be put, not touched in case of error. |
True | if unit is not found. |
False | in case of success. |
|
noexcept |
Computes the discrete hausdorff distance between linestrings.
[in] | srs | The spatial reference system, common to both geometries. |
[in] | g1 | First geometry. |
[in] | g2 | Second geometry. |
[in] | func_name | Function name used in error reporting. |
[out] | hausdorff_distance | The Hausdorff distance between g1 and g2 in the SRS' linear unit. |
[out] | null | True if the return value is NULL. |
false | Success. |
true | An error has occurred. The error has been reported with my_error(). |
|
noexcept |
Computes the intersects relation between two geometries.
Both geometries must be in the same coordinate system (Cartesian or geographic), and the coordinate system of the geometries must match the coordinate system of the SRID. It is the caller's responsibility to guarantee this.
[in] | srs | The spatial reference system, common to both geometries. |
[in] | g1 | First geometry. |
[in] | g2 | Second geometry. |
[in] | func_name | Function name used in error reporting. |
[out] | intersects | Whether g1 intersects g2. |
[out] | null | True if the return value is NULL. |
false | Success. |
true | An error has occurred. The error has been reported with my_error(). |
|
noexcept |
Test whether geometry is geometrically simple.
The coordinate system of the geometry must match the coordinate system of the SRID. It is the caller's responsibility to guarantee this.
[in] | srs | The spatial reference system. |
[in] | g | Geometry for testing. |
[in] | func_name | Function name used in error reporting. |
[out] | result | Whether g is simple. Invalid if result_null . |
[out] | result_null | Whether return value is NULL instead of result . |
false | Success. |
true | An error has occurred. The error has been reported with my_error(). |
|
static |
Checks if a given type is a subtype of a given supertype.
sub | The type to check. |
super | The supertype. |
true | The type is the supertype or a subtype of it. |
false | The type is neither the supertype nor a subtype of it. |
|
noexcept |
Decides if a geometry is valid.
The SRS must match the SRS referenced by the geometry, this is the caller's responsibility.
[in] | srs | The spatial reference system. |
[in] | g | The geometry |
[in] | func_name | Function name used in error reporting. |
[out] | is_valid | The validity of the geometry |
false | No error occurred |
true | An error has occurred, the error has been reported with my_error(). |
|
static |
Checks if a given type is a valid (and supported) WKB type.
type | The type to check |
true | The type is valid. |
false | The type is invalid. |
|
static |
Checks if a given type is a valid type and that it is a subtype of a given supertype.
sub | The type to check. |
super | The supertype. |
true | The type is a valid subtype of the supertype. |
false | The type is invalid or not a subtype of the supertype. |
|
noexcept |
Computes the length of linestrings and multilinestrings.
[in] | srs | The spatial reference system. |
[in] | g1 | linestring or multilinestring. |
[out] | distance | The length of g1 in the SRS linear unit. |
[out] | null | True if the return value is NULL. |
false | Success. |
true | An error has occurred. The error has been reported with my_error(). |
|
noexcept |
Computes the covered by relation between the minimum bounding rectangles of two geometries.
Both geometries must be in the same coordinate system (Cartesian or geographic), and the coordinate system of the geometries must match the coordinate system of the SRID. It is the caller's responsibility to guarantee this.
[in] | srs | The spatial reference system, common to both geometries. |
[in] | g1 | First geometry. |
[in] | g2 | Second geometry. |
[in] | func_name | Function name used in error reporting. |
[out] | covered_by | Whether the MBR of g1 is covered by the MBR of g2. |
[out] | null | True if the return value is NULL. |
false | Success. |
true | An error has occurred. The error has been reported with my_error(). |
|
noexcept |
Computes the disjoint relation between the minimum bounding rectangles of two geometries.
Both geometries must be in the same coordinate system (Cartesian or geographic), and the coordinate system of the geometries must match the coordinate system of the SRID. It is the caller's responsibility to guarantee this.
[in] | srs | The spatial reference system, common to both geometries. |
[in] | g1 | First geometry. |
[in] | g2 | Second geometry. |
[in] | func_name | Function name used in error reporting. |
[out] | disjoint | Whether the MBR of g1 is disjoint from the MBR of g2. |
[out] | null | True if the return value is NULL. |
false | Success. |
true | An error has occurred. The error has been reported with my_error(). |
|
noexcept |
Computes the equals relation between the minimum bounding rectangles of two geometries.
Both geometries must be in the same coordinate system (Cartesian or geographic), and the coordinate system of the geometries must match the coordinate system of the SRID. It is the caller's responsibility to guarantee this.
[in] | srs | The spatial reference system, common to both geometries. |
[in] | g1 | First geometry. |
[in] | g2 | Second geometry. |
[in] | func_name | Function name used in error reporting. |
[out] | equals | Whether the MBR of g1 equals the MBR of g2. |
[out] | null | True if the return value is NULL. |
false | Success. |
true | An error has occurred. The error has been reported with my_error(). |
|
noexcept |
Computes the intersects relation between the minimum bounding rectangles of two geometries.
Both geometries must be in the same coordinate system (Cartesian or geographic), and the coordinate system of the geometries must match the coordinate system of the SRID. It is the caller's responsibility to guarantee this.
[in] | srs | The spatial reference system, common to both geometries. |
[in] | g1 | First geometry. |
[in] | g2 | Second geometry. |
[in] | func_name | Function name used in error reporting. |
[out] | intersects | Whether the MBR of g1 intersects the MBR of g2. |
[out] | null | True if the return value is NULL. |
false | Success. |
true | An error has occurred. The error has been reported with my_error(). |
Checks if an MBR is empty.
By default, BG box coordinates are NaN. If a geometry is empty, its box will have all NaN coordinates.
[in] | mbr | MBR to check. |
true | The MBR is empty. |
false | The MBR is not empty. |
Checks if an MBR represents a line.
Boxes around vertical and horizontal lines collapse so that either the minimum and maximum X coordinate or Y coordinate are equal.
[in] | mbr | MBR to check. |
true | The MBR is a line. |
false | The MBR is not a line. |
Checks if an MBR represents a point.
Boxes around points collapse so that min_corner == max_corner.
[in] | mbr | MBR to check. |
true | The MBR is a point. |
false | The MBR is not a point. |
|
noexcept |
Computes the overlaps relation between the minimum bounding rectangles of two geometries.
Both geometries must be in the same coordinate system (Cartesian or geographic), and the coordinate system of the geometries must match the coordinate system of the SRID. It is the caller's responsibility to guarantee this.
[in] | srs | The spatial reference system, common to both geometries. |
[in] | g1 | First geometry. |
[in] | g2 | Second geometry. |
[in] | func_name | Function name used in error reporting. |
[out] | overlaps | Whether the MBR of g1 overlaps the MBR of g2. |
[out] | null | True if the return value is NULL. |
false | Success. |
true | An error has occurred. The error has been reported with my_error(). |
|
noexcept |
Computes the touches relation between the minimum bounding rectangles of two geometries.
Both geometries must be in the same coordinate system (Cartesian or geographic), and the coordinate system of the geometries must match the coordinate system of the SRID. It is the caller's responsibility to guarantee this.
[in] | srs | The spatial reference system, common to both geometries. |
[in] | g1 | First geometry. |
[in] | g2 | Second geometry. |
[in] | func_name | Function name used in error reporting. |
[out] | touches | Whether the MBR of g1 touches the MBR of g2. |
[out] | null | True if the return value is NULL. |
false | Success. |
true | An error has occurred. The error has been reported with my_error(). |
|
noexcept |
Computes the within relation between the minimum bounding rectangles of two geometries.
Both geometries must be in the same coordinate system (Cartesian or geographic), and the coordinate system of the geometries must match the coordinate system of the SRID. It is the caller's responsibility to guarantee this.
[in] | srs | The spatial reference system, common to both geometries. |
[in] | g1 | First geometry. |
[in] | g2 | Second geometry. |
[in] | func_name | Function name used in error reporting. |
[out] | within | Whether the MBR of g1 is within the MBR of g2. |
[out] | null | True if the return value is NULL. |
false | Success. |
true | An error has occurred. The error has been reported with my_error(). |
Checks if two MBRs are equal.
Empty boxes are considered equal.
[in] | mbr1 | First MBR. |
[in] | mbr2 | Second MBR. |
true | The MBRs are equal. |
false | The MBRs are not equal. |
|
static |
Merges a vector of Cartesian MBRs into one common MBR.
Since the coordinate system doesn't wrap, the order in which MBRs are expanded doesn't matter.
[in] | boxes | Vector of MBRs to merge. |
[out] | mbr | The resulting MBR. |
|
static |
Merges a vector of geographic MBRs into one common MBR.
The coordinate system wraps, so the MBRs must be expanded in the correct order to avoid creating an MBR that is larger than necessary.
If the vector of boxes is empty, the result MBR is unchanged.
[in] | boxes | Vector of MBRs to merge. |
[out] | mbr | The resulting MBR. |
Compares two points.
The point with the lowest X coordinate is the smaller point. If X coordinates are equal, the point with the lowest Y coordinate is the smaller.
lhs | Left hand side. |
rhs | Right hand side. |
true | Left hand side sorts before right hand side. |
false | Left hand side does not sort before right hand side. |
|
noexcept |
Computes the overlaps relation between two geometries.
Both geometries must be in the same coordinate system (Cartesian or geographic), and the coordinate system of the geometries must match the coordinate system of the SRID. It is the caller's responsibility to guarantee this.
[in] | srs | The spatial reference system, common to both geometries. |
[in] | g1 | First geometry. |
[in] | g2 | Second geometry. |
[in] | func_name | Function name used in error reporting. |
[out] | overlaps | Whether g1 overlaps g2. |
[out] | null | True if the return value is NULL. |
false | Success. |
true | An error has occurred. The error has been reported with my_error(). |
bool gis::parse_geometry | ( | THD * | thd, |
const char * | func_name, | ||
const String * | str, | ||
const dd::Spatial_reference_system ** | srs, | ||
std::unique_ptr< Geometry > * | geometry, | ||
bool | treat_unknown_srid_as_cartesian = false |
||
) |
Parses a little-endian geometry string (SRID + WKB).
The geometry is allocated on the heap and ownership is transferred to the caller.
[in] | thd | Thread handle |
[in] | func_name | The function name to use in error messages. |
[in] | str | The geometry string. |
[out] | srs | The spatial reference system of the geometry. |
[out] | geometry | The geometry. |
[in] | treat_unknown_srid_as_cartesian | Whether to treat unknown SRIDs as Cartesian. If false, raise an error if the SRID is unknown. |
false | Success. |
true | Error. my_error() has been called. |
Parses an SRID from a little-endian string.
[in] | str | The string. |
[in] | length | Length of the string. |
[out] | srid | The SRID read from the string. |
false | Success. |
true | Error. my_error() has not been called. |
std::unique_ptr< Geometry > gis::parse_wkb | ( | THD * | thd, |
const dd::Spatial_reference_system * | srs, | ||
const char * | wkb, | ||
std::size_t | length, | ||
bool | ignore_axis_order = false |
||
) |
Parses a geometry WKB string and constructs a geometry object.
The geometry is allocated on the heap and ownership is transferred to the caller.
If ignore_axis_order is true, the string is assumed to be on the geometry storage format, not general WKB. The storage format differs from ordinary WKB by having a fixed x=longitude, y=latitude mapping.
[in] | thd | Thread handle. |
srs | The SRS of the geometry. | |
wkb | The WKB string. | |
length | Length of the WKB string. | |
ignore_axis_order | Ignore SRS axis order and assume it's always long-lat. |
|
static |
Map Cartesian geometry to geographic, mapping degrees east = x, degrees north = y.
Do not canonicalize coordinates of poles.
Used when a SQL function needs to accept Cartesian coordiates as a shorthand for geographic with some default SRS.
|
static |
Map Cartesian geometry to geographic, mapping degrees east = x, degrees north = y.
Do not canonicalize coordinates of poles.
Used when a SQL function needs to accept Cartesian coordiates as a shorthand for geographic with some default SRS.
|
noexcept |
Simplifies a geometry using the Douglas-Peucker algorithm.
[in] | srs | The spatial reference system, common to both geometries. |
[in] | g | The geometry. |
[in] | max_distance | Cut-off distance (in coordinate units) of the Douglas-Peucker algorithm. |
[in] | func_name | Function name used in error reporting. |
[out] | result | The simplified geometry. |
false | Success. |
true | An error has occurred. The error has been reported with my_error(). |
void gis::split_gc | ( | const Geometrycollection * | gc, |
std::unique_ptr< Multipoint > * | mpt, | ||
std::unique_ptr< Multilinestring > * | mls, | ||
std::unique_ptr< Multipolygon > * | mpy | ||
) |
Splits a geometrycollection into points, linestrings and polygons.
All output collections may contain overlapping geometries and duplicates. This is not a problem for the multipoint and multilinestring outputs, but the multipolygon may be geometrically invalid.
[in] | gc | Geometry collection. |
[out] | mpt | All points in the geometrycollection. |
[out] | mls | All linestrings in the geometrycollection. |
[out] | mpy | All polygons in the geometrycollection. |
|
noexcept |
Computes the touches relation between two geometries.
Both geometries must be in the same coordinate system (Cartesian or geographic), and the coordinate system of the geometries must match the coordinate system of the SRID. It is the caller's responsibility to guarantee this.
[in] | srs | The spatial reference system, common to both geometries. |
[in] | g1 | First geometry. |
[in] | g2 | Second geometry. |
[in] | func_name | Function name used in error reporting. |
[out] | touches | Whether g1 touches g2. |
[out] | null | True if the return value is NULL. |
false | Success. |
true | An error has occurred. The error has been reported with my_error(). |
|
noexcept |
Transforms a geometry from one SRS to another.
[in] | source_srs | The SRS of the input geometry. |
[in] | in | The geometry to transform. |
[in] | target_srs | The SRS of the output geometry. |
[in] | func_name | Function name used in error reporting. |
[out] | out | The output geometry. |
false | Success. |
true | An error has occurred. The error has been reported with my_error(). |
const char * gis::type_to_name | ( | Geometry_type | type | ) |
Get the type name string corresponding to a geometry type.
type | The geometry type. |
void gis::typed_gc_union | ( | double | semi_major, |
double | semi_minor, | ||
std::unique_ptr< Multipoint > * | mpt, | ||
std::unique_ptr< Multilinestring > * | mls, | ||
std::unique_ptr< Multipolygon > * | mpy | ||
) |
|
static |
collation_unordered_map< std::string, Unit > gis::units | ( | ) |
A function to obtaint the supported units for the gis module.
|
noexcept |
Computes the within relation between two geometries.
Both geometries must be in the same coordinate system (Cartesian or geographic), and the coordinate system of the geometries must match the coordinate system of the SRID. It is the caller's responsibility to guarantee this.
[in] | srs | The spatial reference system, common to both geometries. |
[in] | g1 | First geometry. |
[in] | g2 | Second geometry. |
[in] | func_name | Function name used in error reporting. |
[out] | within | Whether g1 lies within g2. |
[out] | null | True if the return value is NULL. |
false | Success. |
true | An error has occurred. The error has been reported with my_error(). |
bool gis::write_geometry | ( | const dd::Spatial_reference_system * | srs, |
Geometry & | geometry, | ||
String * | str | ||
) |
Writes a little-endian geometry string (SRID + WKB).
[in] | srs | The SRS of the geometry. |
[in] | geometry | The geometry. |
[out] | str | The string to write the geometry to. |
false | Success. |
true | Error. my_error() has been called. |