MySQL 8.0.39
Source Code Documentation
setops.h
Go to the documentation of this file.
1/* Copyright (c) 2020, 2024, Oracle and/or its affiliates.
2
3 This program is free software; you can redistribute it and/or modify
4 it under the terms of the GNU General Public License, version 2.0,
5 as published by the Free Software Foundation.
6
7 This program is designed to work with certain software (including
8 but not limited to OpenSSL) that is licensed under separate terms,
9 as designated in a particular file or component or in included license
10 documentation. The authors of MySQL hereby grant you an additional
11 permission to link the program and your derivative works with the
12 separately licensed software that they have either included with
13 the program or referenced in the documentation.
14
15 This program is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 GNU General Public License, version 2.0, for more details.
19
20 You should have received a copy of the GNU General Public License
21 along with this program; if not, write to the Free Software
22 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
23/**
24 @file
25
26 This file declares the interface of set GIS operations. These are
27 set operations that compute a geometry given two input geometries.
28*/
29
30#ifndef SQL_GIS_SETOPS_H_INCLUDED
31#define SQL_GIS_SETOPS_H_INCLUDED
32
33#include <memory> // std::unique_ptr
34
35#include "sql/dd/types/spatial_reference_system.h" // dd::Spatial_reference_system
36#include "sql/gis/geometries.h"
37
38namespace gis {
39
40/// Finds the difference between two geometries.
41///
42/// @param[in] srs The spatial reference system.
43/// @param[in] g1 Input geometry.
44/// @param[in] g2 Input geometry.
45/// @param[in] func_name Function name used in error reporting.
46/// @param[out] result Result.
47///
48/// @retval false Success.
49/// @retval true An error has occurred. The error has been reported with
50/// my_error().
51bool difference(const dd::Spatial_reference_system *srs, const Geometry *g1,
52 const Geometry *g2, const char *func_name,
53 std::unique_ptr<Geometry> *result) noexcept;
54
55/// Finds the symdifference between two geometries.
56///
57/// @param[in] srs The spatial reference system.
58/// @param[in] g1 Input geometry.
59/// @param[in] g2 Input geometry.
60/// @param[in] func_name Function name used in error reporting.
61/// @param[out] result Result.
62///
63/// @retval false Success.
64/// @retval true An error has occurred. The error has been reported with
65/// my_error().
66bool symdifference(const dd::Spatial_reference_system *srs, const Geometry *g1,
67 const Geometry *g2, const char *func_name,
68 std::unique_ptr<Geometry> *result) noexcept;
69
70/// Finds the union of two geometries.
71///
72/// @param[in] srs The spatial reference system.
73/// @param[in] g1 Input geometry.
74/// @param[in] g2 Input geometry.
75/// @param[in] func_name Function name used in error reporting.
76/// @param[out] result Result. Invalid if `result_null`.
77/// @param[out] result_null Whether result is `NULL` instead of `result`.
78///
79/// @retval false Success.
80/// @retval true An error has occurred. The error has been reported with
81/// my_error().
82bool union_(const dd::Spatial_reference_system *srs, const Geometry *g1,
83 const Geometry *g2, const char *func_name,
84 std::unique_ptr<Geometry> *result, bool *result_null) noexcept;
85
86/// Finds the intersection between two geometries.
87///
88/// @param[in] srs The spatial reference system.
89/// @param[in] g1 Input geometry.
90/// @param[in] g2 Input geometry.
91/// @param[in] func_name Function name used in error reporting.
92/// @param[out] result Result.
93///
94/// @retval false Success.
95/// @retval true An error has occurred. The error has been reported with
96/// my_error().
97bool intersection(const dd::Spatial_reference_system *srs, const Geometry *g1,
98 const Geometry *g2, const char *func_name,
99 std::unique_ptr<Geometry> *result) noexcept;
100
101} // namespace gis
102
103#endif // SQL_GIS_SETOPS_H_INCLUDED
Definition: spatial.h:213
Definition: spatial_reference_system.h:53
This file declares the geometry class hierarchy used by the server as the internal representation of ...
Definition: area.cc:47
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.
Definition: symdifference.cc:36
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.
Definition: difference.cc:36
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.
Definition: intersection.cc:36
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.
Definition: union.cc:38
Definition: result.h:30