diff options
author | Anel Husakovic <anel@mariadb.org> | 2020-10-29 01:40:31 +0100 |
---|---|---|
committer | Anel Husakovic <anel@mariadb.org> | 2021-03-27 10:42:39 +0100 |
commit | 6769d1a0782f140dcd12c9ced6fda34ac0e41d85 (patch) | |
tree | 496207894596a5fbd77a23ba313f8e15ff16b87e /sql/spatial.h | |
parent | 48141f3c1787de941d969ad1e6675611b2b650c2 (diff) | |
download | mariadb-git-6769d1a0782f140dcd12c9ced6fda34ac0e41d85.tar.gz |
MDEV-13467: Feature request: Support for ST_Distance_Sphere()
- Cherry-pick 51e48b9f8981 - vscode gitignore
- Thanks Robin Dupret for the review.
Reviewed by:daniel@mariadb.org
holyfoot@mariadb.com
Diffstat (limited to 'sql/spatial.h')
-rw-r--r-- | sql/spatial.h | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/sql/spatial.h b/sql/spatial.h index e78da6e615d..1da788b07a0 100644 --- a/sql/spatial.h +++ b/sql/spatial.h @@ -332,6 +332,11 @@ public: m_data+= WKB_HEADER_SIZE; } + const char *get_data_ptr() const + { + return m_data; + } + bool envelope(String *result) const; static Class_info *ci_collection[wkb_last+1]; @@ -410,6 +415,17 @@ public: return 0; } + int get_xy_radian(double *x, double *y) const + { + if (!get_xy(x, y)) + { + *x= (*x)*M_PI/180; + *y= (*y)*M_PI/180; + return 0; + } + return 1; + } + int get_x(double *x) const { if (no_data(m_data, SIZEOF_STORED_DOUBLE)) @@ -436,6 +452,10 @@ public: } int store_shapes(Gcalc_shape_transporter *trn) const; const Class_info *get_class_info() const; + double calculate_haversine(const Geometry *g, const double sphere_radius, + int *error); + int spherical_distance_multipoints(Geometry *g, const double r, double *result, + int *error); }; @@ -535,6 +555,8 @@ public: } int store_shapes(Gcalc_shape_transporter *trn) const; const Class_info *get_class_info() const; + int spherical_distance_multipoints(Geometry *g, const double r, double *res, + int *error); }; |