MySQL 9.0.0
Source Code Documentation
|
Namespaces | |
namespace | 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 | Buffer |
Buffer functor that calls boost::geometry::buffer with correct geometry type and strategy combination. More... | |
struct | BufferStrategies |
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 | Intersection |
Intersection 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... | |
struct | invalid_buffer_argument_exception |
Invalid buffer strategies exception. More... | |
struct | invalid_buffer_result_exception |
Invalid buffer result exception. 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 | Line_interpolate_point |
Line interpolate functor that calls boost::geometry::line_interpolate 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 | Longitude_range_normalizer |
class | Multicurve |
An abstract collection of curves. More... | |
class | Multilinestring |
A collection 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 | SymDifference |
SymDifference functor that calls Boost.Geometry with the correct parameter types. 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 class | Geometry_type : std::uint32_t { kGeometry = 0 , kPoint = 1 , kLinestring = 2 , kPolygon = 3 , kMultipoint = 4 , kMultilinestring = 5 , kMultipolygon = 6 , kGeometrycollection = 7 } |
Types of geometry objects. More... | |
enum class | Coordinate_system { kCartesian = 0 , kGeographic = 1 } |
Types of coordinate systems. More... | |
enum class | Ring_direction { kCW = 0 , kCCW = 1 , kUnknown = 2 } |
Direction of a ring. More... | |
enum class | Unit_Type { kLinear } |
enum class | Byte_order : std::uint8_t { XDR = 0 , 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 | buffer (const dd::Spatial_reference_system *srs, const Geometry &g, const BufferStrategies &strategies, const char *func_name, std::unique_ptr< Geometry > *result) noexcept |
Creates the buffer of a geometry. More... | |
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... | |
bool | difference (const dd::Spatial_reference_system *srs, const Geometry *g1, const Geometry *g2, const char *func_name, std::unique_ptr< Geometry > *result) noexcept |
Finds the difference between two geometries. More... | |
template<typename GC , typename MPt , typename MLs , typename MPy > | |
static std::unique_ptr< Geometry > | typed_geometry_collection_apply_difference (const Difference &f, const Geometrycollection *g1, const Geometry *g2) |
static std::unique_ptr< Geometry > | geometry_collection_apply_difference (const Difference &f, const Geometrycollection *g1, const Geometry *g2) |
Apply a Difference functor to two geometries, where at least one is a geometry collection. 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... | |
std::unique_ptr< gis::Geometrycollection > | narrowest_multigeometry (std::unique_ptr< gis::Geometrycollection > geometrycollection) |
Narrows down a geometrycollection to return a Multipoint, Multilinestring or a Multipolygon if the first level of the geometrycollection contains only points, linestrings or polygons. More... | |
std::unique_ptr< gis::Geometrycollection > | narrowest_multigeometry (std::unique_ptr< Geometrycollection > geometrycollection) |
Narrows down a geometrycollection to return a Multipoint, Multilinestring or a Multipolygon if the first level of the geometrycollection contains only points, linestrings or polygons. 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... | |
bool | intersection (const dd::Spatial_reference_system *srs, const Geometry *g1, const Geometry *g2, const char *func_name, std::unique_ptr< Geometry > *result) noexcept |
Finds the intersection between two geometries. More... | |
static bool | is_collection (const Geometry *g) |
template<typename MPt , typename MLs > | |
static auto | remove_overlapping_mpt_mls (MPt const &mpt, MLs const &mls, Geometrycollection &result) |
template<typename MPt , typename MLs , typename MPy > | |
static auto | remove_overlapping_mpt_mls_mpy (MPt const &mpt, MLs const &mls, MPy const &mpy, Geometrycollection &result) |
template<typename MPt , typename MLs , typename MPy , typename Geometry1 , typename Geometry2 > | |
static auto | apply_bg_intersection (Geometry1 const &g1, Geometry2 const &g2) |
template<typename MPt , typename MLs , typename MPy , typename Geometry1 , typename Geometry2 , typename Strategy > | |
static auto | apply_bg_intersection (Geometry1 const &g1, Geometry2 const &g2, Strategy const &strategy) |
template<typename MPt , typename MLs , typename Geometry1 , typename Geometry2 > | |
static auto | apply_bg_brute_force_intersection (Geometry1 const &g1, Geometry2 const &g2) |
template<typename MPt , typename MLs , typename Geometry1 , typename Geometry2 , typename Strategy > | |
static auto | apply_bg_brute_force_intersection (Geometry1 const &g1, Geometry2 const &g2, Strategy const &strategy) |
template<typename GC , typename MPt , typename MLs , typename MPy > | |
static std::unique_ptr< Geometry > | typed_geometry_collection_apply_intersection (const Intersection &f, const Geometrycollection *g1, const Geometry *g2) |
static std::unique_ptr< Geometry > | geometry_collection_apply_intersection (const Intersection &f, const Geometrycollection *g1, const Geometry *g2) |
Apply a Intersection functor to two geometries, where at least one is a geometry collection. 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 | line_interpolate_point (const dd::Spatial_reference_system *srs, const Geometry *g, const double interpolation_distance, const bool return_multiple_points, const char *func_name, std::unique_ptr< Geometry > *result, bool *result_null) noexcept |
Finds the point in a linestring at a given distance from the starting point. 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... | |
bool | knn_query_to_mbr (THD *thd, Item *knn_query_item, double(&coordinates)[5]) |
Parse the input geometry, computes and returns the MBR. 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 | symdifference (const dd::Spatial_reference_system *srs, const Geometry *g1, const Geometry *g2, const char *func_name, std::unique_ptr< Geometry > *result) noexcept |
Finds the symdifference between two geometries. More... | |
bool | union_ (const dd::Spatial_reference_system *srs, const Geometry *g1, const Geometry *g2, const char *func_name, std::unique_ptr< Geometry > *result, bool *result_null) noexcept |
Finds the union of 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... | |
template<typename MPt , typename MLs , typename MPy , typename GC > | |
static void | typed_remove_duplicates (double semi_major, double semi_minor, std::unique_ptr< Geometry > *g) |
void | remove_duplicates (double semi_major, double semi_minor, std::unique_ptr< Geometry > *g) |
Removes all duplicates in a geometrycollection. More... | |
void | narrow_geometry (std::unique_ptr< Geometry > *g) |
Narrow a geometry to its simplest form. 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 PointLike , typename Geometry , typename std::enable_if_t< std::is_same< PointLike, Cartesian_point >::value||std::is_same< PointLike, Cartesian_multipoint >::value > * = nullptr> | |
bool | call_bg_disjoint (const PointLike &g1, const Geometry &g2, const SymDifference &) |
template<typename MultipointOrLinear , typename Geometry , typename GeometryOut , typename std::enable_if_t< std::is_same< MultipointOrLinear, Cartesian_linestring >::value||std::is_same< MultipointOrLinear, Cartesian_multipoint >::value||std::is_same< MultipointOrLinear, Cartesian_multilinestring >::value > * = nullptr> | |
void | call_bg_difference (const MultipointOrLinear &g1, const Geometry &g2, GeometryOut &gout, const SymDifference &) |
template<typename Geometry , typename GeometryOut > | |
void | call_bg_difference (const Geographic_multipoint &g1, const Geometry &g2, GeometryOut &gout, const SymDifference &f) |
template<typename Linear , typename Geometry , typename GeometryOut , typename std::enable_if_t< std::is_same< Linear, Geographic_linestring >::value||std::is_same< Linear, Geographic_multilinestring >::value > * = nullptr> | |
void | call_bg_difference (const Linear &g1, const Geometry &g2, GeometryOut &gout, const SymDifference &f) |
template<typename MultiPointType , typename Geometry1 , typename Geometry2 > | |
static auto | symdifference_pointlike_pointlike (Geometry1 g1, Geometry2 g2) |
template<typename GCType , typename Geometry1 , typename Geometry2 > | |
static auto | symdifference_multipoint_linear_or_areal (const SymDifference &f, Geometry1 g1, Geometry2 g2) |
template<typename GCType , typename Geometry1 , typename Geometry2 > | |
static auto | symdifference_point_linear_or_areal (const SymDifference &f, Geometry1 g1, Geometry2 g2) |
template<typename MlsType , typename GCType , typename Linear , typename Areal > | |
static auto | symdifference_linear_areal (const SymDifference &f, Linear g1, Areal g2) |
template<typename MptType , typename MlsType , typename MpyType , typename PtMpt , typename GC > | |
std::unique_ptr< Geometry > | symdifference_pointlike_geomcol (const SymDifference &f, PtMpt g1, GC *g2) |
template<typename MptType , typename MlsType , typename MpyType , typename Linear , typename GC > | |
std::unique_ptr< Geometry > | symdifference_linear_geomcol (const SymDifference &f, Linear g1, GC *g2) |
template<typename MptType , typename MlsType , typename Areal , typename GC > | |
std::unique_ptr< Geometry > | symdifference_areal_geomcol (const SymDifference &f, Areal g1, GC *g2) |
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... | |
template<typename CartesianGeometry , typename GeographicGeometry , typename InputGeometry > | |
auto | transform_helper (const InputGeometry &g, const Coordinate_system &m_output_cs, const boost::geometry::srs::transformation<> &m_transformation) |
template<typename InputGeometryCollection > | |
auto | transform_gc_helper (const InputGeometryCollection &g, const Coordinate_system &m_output_cs, const Transform &transform) |
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... | |
template<typename GC , typename MPt , typename MLs , typename MPy > | |
static std::unique_ptr< Geometrycollection > | typed_geometry_collection_apply_union (const Union &f, const Geometrycollection *g1, const Geometry *g2) |
static std::unique_ptr< Geometrycollection > | geometry_collection_apply_union (const Union &f, const Geometrycollection *g1, const Geometry *g2) |
Apply a Union functor to two geometries, where at least one is a geometry collection. 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... | |
Variables | |
constexpr uint | kEndRound = 1 |
constexpr uint | kEndFlat = 2 |
constexpr uint | kJoinRound = 3 |
constexpr uint | kJoinMiter = 4 |
constexpr uint | kPointCircle = 5 |
constexpr uint | kPointSquare = 6 |
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 |
|
static |
|
static |
|
static |
|
static |
|
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. |
|
noexcept |
Creates the buffer of a geometry.
[in] | srs | The spatial reference system. |
[in] | g | Input geometry. |
[in] | strategies | Struct holding strategy arguments for buffer creation |
[in] | func_name | Function name used in error reporting. |
[out] | result | The geometry that is the buffer of input geometry g |
false | Success. |
true | An error has occurred. The error has been reported with my_error(). |
void gis::call_bg_difference | ( | const Geographic_multipoint & | g1, |
const Geometry & | g2, | ||
GeometryOut & | gout, | ||
const SymDifference & | f | ||
) |
void gis::call_bg_difference | ( | const Linear & | g1, |
const Geometry & | g2, | ||
GeometryOut & | gout, | ||
const SymDifference & | f | ||
) |
void gis::call_bg_difference | ( | const MultipointOrLinear & | g1, |
const Geometry & | g2, | ||
GeometryOut & | gout, | ||
const SymDifference & | |||
) |
bool gis::call_bg_disjoint | ( | const PointLike & | g1, |
const Geometry & | g2, | ||
const SymDifference & | f | ||
) |
|
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 |
Finds the difference between two geometries.
[in] | srs | The spatial reference system. |
[in] | g1 | Input geometry. |
[in] | g2 | Input geometry. |
[in] | func_name | Function name used in error reporting. |
[out] | result | Result. |
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 Difference functor to two geometries, where at least one is a geometry collection.
Return the difference of the two geometries.
f | Functor to apply. |
g1 | First geometry, of type Geometrycollection. |
g2 | Second geometry. |
unique | pointer to a Geometry. |
|
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 a Intersection functor to two geometries, where at least one is a geometry collection.
Return the intersection of the two geometries.
f | Functor to apply. |
g1 | First geometry, of type Geometrycollection. |
g2 | Second geometry. |
unique | pointer to a Geometry. |
|
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. |
|
static |
Apply a Union functor to two geometries, where at least one is a geometry collection.
Return the union of all the geometries of the input geometries.
f | Functor to apply. |
g1 | First geometry, of type Geometrycollection. |
g2 | Second geometry. |
unique | pointer to a Geometry. |
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 |
Finds the intersection between two geometries.
[in] | srs | The spatial reference system. |
[in] | g1 | Input geometry. |
[in] | g2 | Input geometry. |
[in] | func_name | Function name used in error reporting. |
[out] | result | Result. |
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(). |
|
static |
|
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. |
Parse the input geometry, computes and returns the MBR.
[in] | thd | The thread |
[in] | knn_query_item | The input geometry |
[out] | coordinates | The coordinates of the MBR |
|
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 |
Finds the point in a linestring at a given distance from the starting point.
[in] | srs | The spatial reference system. |
[in] | g | Input geometry. |
[in] | interpolation_distance | The distance from the starting point. |
[in] | return_multiple_points | True if the return geometry should be a multipoint. False if the return value should be a single point. |
[in] | func_name | Function name used in error reporting. |
[out] | result | Result. Invalid if result_null . |
[out] | result_null | Whether result is NULL instead of result . |
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(). |
bool gis::mbr_is_empty | ( | Box const & | mbr | ) |
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. |
bool gis::mbr_is_line | ( | Box const & | mbr | ) |
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. |
bool gis::mbr_is_point | ( | Box const & | mbr | ) |
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. |
void gis::narrow_geometry | ( | std::unique_ptr< Geometry > * | g | ) |
Narrow a geometry to its simplest form.
E.g. for a multipoint with only one point, the geometry is reduced to that point. For an input geometry which cannot be narrowed further, the function does nothing.
[in,out] | g | The geometry to possibly narrow. |
std::unique_ptr< gis::Geometrycollection > gis::narrowest_multigeometry | ( | std::unique_ptr< Geometrycollection > | geometrycollection | ) |
Narrows down a geometrycollection to return a Multipoint, Multilinestring or a Multipolygon if the first level of the geometrycollection contains only points, linestrings or polygons.
Otherwise, if the contents is heterogeneous or contains a geometrycollection, returns the input geometrycollection.
[in] | geometrycollection | Geometrycollection to be narroweed down. |
std::unique_ptr< gis::Geometrycollection > gis::narrowest_multigeometry | ( | std::unique_ptr< Geometrycollection > | geometrycollection | ) |
Narrows down a geometrycollection to return a Multipoint, Multilinestring or a Multipolygon if the first level of the geometrycollection contains only points, linestrings or polygons.
Otherwise, if the contents is heterogeneous or contains a geometrycollection, returns the input geometrycollection.
[in] | geometrycollection | Geometrycollection to be narroweed down. |
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. |
bool gis::parse_srid | ( | const char * | str, |
std::size_t | length, | ||
srid_t * | srid | ||
) |
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 coordinates 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 coordinates as a shorthand for geographic with some default SRS.
void gis::remove_duplicates | ( | double | semi_major, |
double | semi_minor, | ||
std::unique_ptr< Geometry > * | g | ||
) |
Removes all duplicates in a geometrycollection.
If the geometry is not a collection, the function does nothing. Duplicates are removed in all levels, so for a geometrycollection, the function is called for each member geometry as well.
[in] | semi_major | Semi-major axis of ellipsoid. |
[in] | semi_minor | Semi-minor axis of ellipsoid. |
[in,out] | g | The geometry to remove duplicates from. |
|
static |
|
static |
|
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 |
Finds the symdifference between two geometries.
[in] | srs | The spatial reference system. |
[in] | g1 | Input geometry. |
[in] | g2 | Input geometry. |
[in] | func_name | Function name used in error reporting. |
[out] | result | Result. |
false | Success. |
true | An error has occurred. The error has been reported with my_error(). |
std::unique_ptr< Geometry > gis::symdifference_areal_geomcol | ( | const SymDifference & | f, |
Areal | g1, | ||
GC * | g2 | ||
) |
|
static |
std::unique_ptr< Geometry > gis::symdifference_linear_geomcol | ( | const SymDifference & | f, |
Linear | g1, | ||
GC * | g2 | ||
) |
|
static |
|
static |
std::unique_ptr< Geometry > gis::symdifference_pointlike_geomcol | ( | const SymDifference & | f, |
PtMpt | g1, | ||
GC * | g2 | ||
) |
|
static |
|
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(). |
auto gis::transform_gc_helper | ( | const InputGeometryCollection & | g, |
const Coordinate_system & | m_output_cs, | ||
const Transform & | transform | ||
) |
auto gis::transform_helper | ( | const InputGeometry & | g, |
const Coordinate_system & | m_output_cs, | ||
const boost::geometry::srs::transformation<> & | m_transformation | ||
) |
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 |
|
static |
|
static |
|
static |
|
static |
|
noexcept |
Finds the union of two geometries.
[in] | srs | The spatial reference system. |
[in] | g1 | Input geometry. |
[in] | g2 | Input geometry. |
[in] | func_name | Function name used in error reporting. |
[out] | result | Result. Invalid if result_null . |
[out] | result_null | Whether result is NULL instead of result . |
false | Success. |
true | An error has occurred. The error has been reported with my_error(). |
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. |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |