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