summaryrefslogtreecommitdiff
path: root/sql/spatial.h
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2021-03-31 11:05:21 +0300
committerMarko Mäkelä <marko.makela@mariadb.com>2021-03-31 11:05:21 +0300
commit5eae8c274244aaa98320dda3e686f264e8a447d6 (patch)
treed99f593c55e008af4df649ff456868724e7f2d32 /sql/spatial.h
parentbf310b4cfb5c275f8c555d469ef310bdd1219920 (diff)
parent8341f582b2fe864027954282f96fb84e560cae72 (diff)
downloadmariadb-git-5eae8c274244aaa98320dda3e686f264e8a447d6.tar.gz
Merge 10.4 into 10.5
Diffstat (limited to 'sql/spatial.h')
-rw-r--r--sql/spatial.h22
1 files changed, 22 insertions, 0 deletions
diff --git a/sql/spatial.h b/sql/spatial.h
index 0b998e2e55c..42c4a760db2 100644
--- a/sql/spatial.h
+++ b/sql/spatial.h
@@ -333,6 +333,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];
@@ -411,6 +416,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))
@@ -437,6 +453,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);
};
@@ -536,6 +556,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);
};