MySQL  8.0.28
Source Code Documentation
line_interpolate.h
Go to the documentation of this file.
1 /* Copyright (c) 2020, 2021, 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 /**
24  @file
25 
26  Interface for obtaining a point at a given distance on a linestring
27 */
28 
29 #ifndef SQL_GIS_LINE_INTERPOLATE_H_INCLUDED
30 #define SQL_GIS_LINE_INTERPOLATE_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 
37 namespace gis {
38 /// Finds the point in a linestring at a given distance from the starting point.
39 ///
40 /// @param[in] srs The spatial reference system.
41 /// @param[in] g Input geometry.
42 /// @param[in] interpolation_distance The distance from the starting point.
43 /// @param[in] return_multiple_points True if the return geometry should be a
44 /// multipoint. False if the return value should be a single point.
45 /// @param[in] func_name Function name used in error reporting.
46 /// @param[out] result Result. Invalid if `result_null`.
47 /// @param[out] result_null Whether result is `NULL` instead of `result`.
48 ///
49 /// @retval false Success.
50 /// @retval true An error has occured. The error has been reported with
51 /// my_error().
53  const Geometry *g,
54  const double interpolation_distance,
55  const bool return_multiple_points,
56  const char *func_name,
57  std::unique_ptr<Geometry> *result,
58  bool *result_null) noexcept;
59 
60 } // namespace gis
61 
62 #endif // SQL_GIS_LINE_INTERPOLATE_H_INCLUDED
Definition: spatial.h:214
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 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.
Definition: line_interpolate.cc:87
Definition: result.h:29