MySQL 8.0.39
Source Code Documentation
transform.h
Go to the documentation of this file.
1#ifndef SQL_GIS_TRANSFORM_H_INCLUDED
2#define SQL_GIS_TRANSFORM_H_INCLUDED
3
4// Copyright (c) 2018, 2024, Oracle and/or its affiliates.
5//
6// This program is free software; you can redistribute it and/or modify
7// it under the terms of the GNU General Public License, version 2.0,
8// as published by the Free Software Foundation.
9//
10// This program is designed to work with certain software (including
11// but not limited to OpenSSL) that is licensed under separate terms,
12// as designated in a particular file or component or in included license
13// documentation. The authors of MySQL hereby grant you an additional
14// permission to link the program and your derivative works with the
15// separately licensed software that they have either included with
16// the program or referenced in the documentation.
17//
18// This program is distributed in the hope that it will be useful,
19// but WITHOUT ANY WARRANTY; without even the implied warranty of
20// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21// GNU General Public License, version 2.0, for more details.
22//
23// You should have received a copy of the GNU General Public License
24// along with this program; if not, write to the Free Software
25// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
26
27/// @file
28///
29/// This file declares the interface of gis::transform, a function that converts
30/// geometries from one spatial reference system to another.
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/// Transforms a geometry from one SRS to another.
40///
41/// @param[in] source_srs The SRS of the input geometry.
42/// @param[in] in The geometry to transform.
43/// @param[in] target_srs The SRS of the output geometry.
44/// @param[in] func_name Function name used in error reporting.
45/// @param[out] out The output geometry.
46///
47/// @retval false Success.
48/// @retval true An error has occurred. The error has been reported with
49/// my_error().
50bool transform(const dd::Spatial_reference_system *source_srs,
51 const Geometry &in,
52 const dd::Spatial_reference_system *target_srs,
53 const char *func_name, std::unique_ptr<Geometry> *out) noexcept;
54
55} // namespace gis
56
57#endif // SQL_GIS_TRANSFORM_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 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.
Definition: transform.cc:216