OmniSciDB
bf83d84833
|
#include "../Shared/funcannotations.h"
#include <cstdint>
#include <cmath>
#include <cstdlib>
#include "OmniSciTypes.h"
#include "ExtensionFunctionsArray.hpp"
#include "ExtensionFunctionsGeo.hpp"
#include "ExtensionFunctionsTesting.hpp"
Go to the source code of this file.
Functions | |
EXTENSION_NOINLINE double | Acos (const double x) |
EXTENSION_NOINLINE double | Asin (const double x) |
EXTENSION_NOINLINE double | Atan (const double x) |
EXTENSION_NOINLINE double | Atan2 (const double y, const double x) |
EXTENSION_NOINLINE double | Ceil (double x) |
EXTENSION_NOINLINE float | Ceil__ (float x) |
EXTENSION_NOINLINE int16_t | Ceil__1 (int16_t x) |
EXTENSION_NOINLINE int32_t | Ceil__2 (int32_t x) |
EXTENSION_NOINLINE int64_t | Ceil__3 (int64_t x) |
EXTENSION_NOINLINE double | Cos (const double x) |
EXTENSION_NOINLINE double | Cot (const double x) |
EXTENSION_NOINLINE double | degrees (double x) |
EXTENSION_NOINLINE double | Exp (double x) |
EXTENSION_NOINLINE double | Floor (double x) |
EXTENSION_NOINLINE float | Floor__ (float x) |
EXTENSION_NOINLINE int16_t | Floor__1 (int16_t x) |
EXTENSION_NOINLINE int32_t | Floor__2 (int32_t x) |
EXTENSION_NOINLINE int64_t | Floor__3 (int64_t x) |
EXTENSION_NOINLINE double | ln (const double x) |
EXTENSION_NOINLINE double | ln__ (const float x) |
EXTENSION_NOINLINE double | Log (const double x) |
EXTENSION_NOINLINE double | Log__ (const float x) |
EXTENSION_NOINLINE double | Log10 (const double x) |
EXTENSION_NOINLINE double | Log10__ (const float x) |
EXTENSION_NOINLINE double | pi () |
EXTENSION_NOINLINE double | power (const double x, const double y) |
EXTENSION_NOINLINE double | radians (const double x) |
EXTENSION_NOINLINE double | Round (const double x, const int32_t y) |
EXTENSION_NOINLINE float | Round__ (const float x, const int32_t y) |
EXTENSION_NOINLINE int16_t | Round__1 (const int16_t x, const int32_t y) |
EXTENSION_NOINLINE int32_t | Round__2 (const int32_t x, const int32_t y) |
EXTENSION_NOINLINE int64_t | Round__3 (const int64_t x, const int32_t y) |
EXTENSION_NOINLINE int64_t | Round__4 (const int64_t x, const int32_t y0, const int32_t scale) |
EXTENSION_NOINLINE double | Round2_to_digit (const double x, const int32_t y) |
EXTENSION_NOINLINE double | round_to_digit (const double x, const int32_t y) |
EXTENSION_NOINLINE double | Sin (const double x) |
EXTENSION_NOINLINE double | Tan (const double x) |
EXTENSION_NOINLINE double | Tan__ (const float x) |
EXTENSION_NOINLINE double | Truncate (const double x, const int32_t y) |
EXTENSION_NOINLINE float | Truncate__ (const float x, const int32_t y) |
EXTENSION_NOINLINE int16_t | Truncate__1 (const int16_t x, const int32_t y) |
EXTENSION_NOINLINE int32_t | Truncate__2 (const int32_t x, const int32_t y) |
EXTENSION_NOINLINE int64_t | Truncate__3 (const int64_t x, const int32_t y) |
EXTENSION_NOINLINE bool | isNan (const double x) |
EXTENSION_NOINLINE bool | isNan__ (const float x) |
EXTENSION_NOINLINE double | conv_4326_900913_x (const double x) |
EXTENSION_NOINLINE double | conv_4326_900913_y (const double y) |
EXTENSION_NOINLINE double | distance_in_meters (const double fromlon, const double fromlat, const double tolon, const double tolat) |
Computes the distance, in meters, between two WGS-84 positions. More... | |
EXTENSION_NOINLINE double | distance_in_meters__ (const float fromlon, const float fromlat, const float tolon, const float tolat) |
EXTENSION_NOINLINE double | approx_distance_in_meters (const float fromlon, const float fromlat, const float tolon, const float tolat) |
EXTENSION_NOINLINE float | rect_pixel_bin (const double val, const double min, const double max, const int32_t numbins, const int32_t dimensionsize) |
EXTENSION_NOINLINE float | rect_pixel_bin_x (const double valx, const double minx, const double maxx, const double rectwidth, const double offsetx, const int32_t imgwidth) |
EXTENSION_NOINLINE float | rect_pixel_bin_y (const double valy, const double miny, const double maxy, const double rectheight, const double offsety, const int32_t imgheight) |
EXTENSION_NOINLINE int32_t | rect_pixel_bin_packed (const double valx, const double minx, const double maxx, const double valy, const double miny, const double maxy, const double rectwidth, const double rectheight, const double offsetx, const double offsety, const int32_t imgwidth, const int32_t imgheight) |
EXTENSION_NOINLINE float | reg_hex_horiz_pixel_bin_x (const double valx, const double minx, const double maxx, const double valy, const double miny, const double maxy, const double hexwidth, const double hexheight, const double offsetx, const double offsety, const int32_t imgwidth, const int32_t imgheight) |
EXTENSION_NOINLINE float | reg_hex_horiz_pixel_bin_y (const double valx, const double minx, const double maxx, const double valy, const double miny, const double maxy, const double hexwidth, const double hexheight, const double offsetx, const double offsety, const int32_t imgwidth, const int32_t imgheight) |
EXTENSION_NOINLINE int32_t | reg_hex_horiz_pixel_bin_packed (const double valx, const double minx, const double maxx, const double valy, const double miny, const double maxy, const double hexwidth, const double hexheight, const double offsetx, const double offsety, const int32_t imgwidth, const int32_t imgheight) |
EXTENSION_NOINLINE float | reg_hex_vert_pixel_bin_x (const double valx, const double minx, const double maxx, const double valy, const double miny, const double maxy, const double hexwidth, const double hexheight, const double offsetx, const double offsety, const int32_t imgwidth, const int32_t imgheight) |
EXTENSION_NOINLINE float | reg_hex_vert_pixel_bin_y (const double valx, const double minx, const double maxx, const double valy, const double miny, const double maxy, const double hexwidth, const double hexheight, const double offsetx, const double offsety, const int32_t imgwidth, const int32_t imgheight) |
EXTENSION_NOINLINE int32_t | reg_hex_vert_pixel_bin_packed (const double valx, const double minx, const double maxx, const double valy, const double miny, const double maxy, const double hexwidth, const double hexheight, const double offsetx, const double offsety, const int32_t imgwidth, const int32_t imgheight) |
EXTENSION_NOINLINE double | convert_meters_to_merc_pixel_width (const double meters, const double lon, const double lat, const double min_lon, const double max_lon, const int32_t img_width, const double min_width) |
EXTENSION_NOINLINE double | convert_meters_to_merc_pixel_height (const double meters, const double lon, const double lat, const double min_lat, const double max_lat, const int32_t img_height, const double min_height) |
EXTENSION_INLINE bool | is_point_in_merc_view (const double lon, const double lat, const double min_lon, const double max_lon, const double min_lat, const double max_lat) |
EXTENSION_NOINLINE bool | is_point_size_in_merc_view (const double lon, const double lat, const double meters, const double min_lon, const double max_lon, const double min_lat, const double max_lat) |
EXTENSION_NOINLINE double Acos | ( | const double | x | ) |
Definition at line 42 of file ExtensionFunctions.hpp.
EXTENSION_NOINLINE double approx_distance_in_meters | ( | const float | fromlon, |
const float | fromlat, | ||
const float | tolon, | ||
const float | tolat | ||
) |
Definition at line 430 of file ExtensionFunctions.hpp.
References distance_in_meters__().
EXTENSION_NOINLINE double Asin | ( | const double | x | ) |
Definition at line 47 of file ExtensionFunctions.hpp.
EXTENSION_NOINLINE double Atan | ( | const double | x | ) |
Definition at line 52 of file ExtensionFunctions.hpp.
EXTENSION_NOINLINE double Atan2 | ( | const double | y, |
const double | x | ||
) |
Definition at line 57 of file ExtensionFunctions.hpp.
EXTENSION_NOINLINE double Ceil | ( | double | x | ) |
Definition at line 62 of file ExtensionFunctions.hpp.
EXTENSION_NOINLINE float Ceil__ | ( | float | x | ) |
Definition at line 67 of file ExtensionFunctions.hpp.
EXTENSION_NOINLINE int16_t Ceil__1 | ( | int16_t | x | ) |
Definition at line 72 of file ExtensionFunctions.hpp.
EXTENSION_NOINLINE int32_t Ceil__2 | ( | int32_t | x | ) |
Definition at line 77 of file ExtensionFunctions.hpp.
EXTENSION_NOINLINE int64_t Ceil__3 | ( | int64_t | x | ) |
Definition at line 82 of file ExtensionFunctions.hpp.
EXTENSION_NOINLINE double conv_4326_900913_x | ( | const double | x | ) |
Definition at line 367 of file ExtensionFunctions.hpp.
Referenced by convert_meters_to_merc_pixel_width(), and transform_coord().
EXTENSION_NOINLINE double conv_4326_900913_y | ( | const double | y | ) |
Definition at line 372 of file ExtensionFunctions.hpp.
Referenced by convert_meters_to_merc_pixel_height(), and transform_coord().
EXTENSION_NOINLINE double convert_meters_to_merc_pixel_height | ( | const double | meters, |
const double | lon, | ||
const double | lat, | ||
const double | min_lat, | ||
const double | max_lat, | ||
const int32_t | img_height, | ||
const double | min_height | ||
) |
Definition at line 1051 of file ExtensionFunctions.hpp.
References conv_4326_900913_y().
EXTENSION_NOINLINE double convert_meters_to_merc_pixel_width | ( | const double | meters, |
const double | lon, | ||
const double | lat, | ||
const double | min_lon, | ||
const double | max_lon, | ||
const int32_t | img_width, | ||
const double | min_width | ||
) |
Definition at line 1025 of file ExtensionFunctions.hpp.
References conv_4326_900913_x().
EXTENSION_NOINLINE double Cos | ( | const double | x | ) |
Definition at line 87 of file ExtensionFunctions.hpp.
EXTENSION_NOINLINE double Cot | ( | const double | x | ) |
Definition at line 92 of file ExtensionFunctions.hpp.
EXTENSION_NOINLINE double degrees | ( | double | x | ) |
Definition at line 97 of file ExtensionFunctions.hpp.
EXTENSION_NOINLINE double distance_in_meters | ( | const double | fromlon, |
const double | fromlat, | ||
const double | tolon, | ||
const double | tolat | ||
) |
Computes the distance, in meters, between two WGS-84 positions.
The result is equal to EARTH_RADIUS_IN_METERS*ArcInRadians(from,to)
ArcInRadians is equal to Distance(from,to)/EARTH_RADIUS_IN_METERS
= 2*asin(sqrt(h(d/EARTH_RADIUS_IN_METERS )))
where:
h(x)=sin²(x/2)
code attribution: http://blog.julien.cayzac.name/2008/10/arc-and-distance-between-two-points-on.html
The haversine formula gives: h(d/R) = h(from.lat-to.lat)+h(from.lon-to.lon)+cos(from.lat)*cos(to.lat)
Definition at line 398 of file ExtensionFunctions.hpp.
Referenced by length_linestring(), ST_Distance_LineString_LineString_Geodesic(), ST_Distance_Point_LineString_Geodesic(), and ST_Distance_Point_Point_Geodesic().
EXTENSION_NOINLINE double distance_in_meters__ | ( | const float | fromlon, |
const float | fromlat, | ||
const float | tolon, | ||
const float | tolat | ||
) |
Definition at line 414 of file ExtensionFunctions.hpp.
Referenced by approx_distance_in_meters().
EXTENSION_NOINLINE double Exp | ( | double | x | ) |
Definition at line 102 of file ExtensionFunctions.hpp.
EXTENSION_NOINLINE double Floor | ( | double | x | ) |
Definition at line 107 of file ExtensionFunctions.hpp.
EXTENSION_NOINLINE float Floor__ | ( | float | x | ) |
Definition at line 112 of file ExtensionFunctions.hpp.
EXTENSION_NOINLINE int16_t Floor__1 | ( | int16_t | x | ) |
Definition at line 117 of file ExtensionFunctions.hpp.
EXTENSION_NOINLINE int32_t Floor__2 | ( | int32_t | x | ) |
Definition at line 122 of file ExtensionFunctions.hpp.
EXTENSION_NOINLINE int64_t Floor__3 | ( | int64_t | x | ) |
Definition at line 127 of file ExtensionFunctions.hpp.
EXTENSION_INLINE bool is_point_in_merc_view | ( | const double | lon, |
const double | lat, | ||
const double | min_lon, | ||
const double | max_lon, | ||
const double | min_lat, | ||
const double | max_lat | ||
) |
Definition at line 1076 of file ExtensionFunctions.hpp.
EXTENSION_NOINLINE bool is_point_size_in_merc_view | ( | const double | lon, |
const double | lat, | ||
const double | meters, | ||
const double | min_lon, | ||
const double | max_lon, | ||
const double | min_lat, | ||
const double | max_lat | ||
) |
Definition at line 1085 of file ExtensionFunctions.hpp.
EXTENSION_NOINLINE bool isNan | ( | const double | x | ) |
Definition at line 357 of file ExtensionFunctions.hpp.
EXTENSION_NOINLINE bool isNan__ | ( | const float | x | ) |
Definition at line 362 of file ExtensionFunctions.hpp.
EXTENSION_NOINLINE double ln | ( | const double | x | ) |
Definition at line 132 of file ExtensionFunctions.hpp.
EXTENSION_NOINLINE double ln__ | ( | const float | x | ) |
Definition at line 137 of file ExtensionFunctions.hpp.
EXTENSION_NOINLINE double Log | ( | const double | x | ) |
Definition at line 142 of file ExtensionFunctions.hpp.
EXTENSION_NOINLINE double Log10 | ( | const double | x | ) |
Definition at line 152 of file ExtensionFunctions.hpp.
EXTENSION_NOINLINE double Log10__ | ( | const float | x | ) |
Definition at line 157 of file ExtensionFunctions.hpp.
EXTENSION_NOINLINE double Log__ | ( | const float | x | ) |
Definition at line 147 of file ExtensionFunctions.hpp.
EXTENSION_NOINLINE double pi | ( | ) |
Definition at line 162 of file ExtensionFunctions.hpp.
Referenced by geotransform_4326_to_900913().
EXTENSION_NOINLINE double power | ( | const double | x, |
const double | y | ||
) |
Definition at line 167 of file ExtensionFunctions.hpp.
EXTENSION_NOINLINE double radians | ( | const double | x | ) |
Definition at line 172 of file ExtensionFunctions.hpp.
EXTENSION_NOINLINE float rect_pixel_bin | ( | const double | val, |
const double | min, | ||
const double | max, | ||
const int32_t | numbins, | ||
const int32_t | dimensionsize | ||
) |
deprecated
Definition at line 450 of file ExtensionFunctions.hpp.
EXTENSION_NOINLINE int32_t rect_pixel_bin_packed | ( | const double | valx, |
const double | minx, | ||
const double | maxx, | ||
const double | valy, | ||
const double | miny, | ||
const double | maxy, | ||
const double | rectwidth, | ||
const double | rectheight, | ||
const double | offsetx, | ||
const double | offsety, | ||
const int32_t | imgwidth, | ||
const int32_t | imgheight | ||
) |
Definition at line 510 of file ExtensionFunctions.hpp.
EXTENSION_NOINLINE float rect_pixel_bin_x | ( | const double | valx, |
const double | minx, | ||
const double | maxx, | ||
const double | rectwidth, | ||
const double | offsetx, | ||
const int32_t | imgwidth | ||
) |
Definition at line 462 of file ExtensionFunctions.hpp.
EXTENSION_NOINLINE float rect_pixel_bin_y | ( | const double | valy, |
const double | miny, | ||
const double | maxy, | ||
const double | rectheight, | ||
const double | offsety, | ||
const int32_t | imgheight | ||
) |
Definition at line 486 of file ExtensionFunctions.hpp.
EXTENSION_NOINLINE int32_t reg_hex_horiz_pixel_bin_packed | ( | const double | valx, |
const double | minx, | ||
const double | maxx, | ||
const double | valy, | ||
const double | miny, | ||
const double | maxy, | ||
const double | hexwidth, | ||
const double | hexheight, | ||
const double | offsetx, | ||
const double | offsety, | ||
const int32_t | imgwidth, | ||
const int32_t | imgheight | ||
) |
Definition at line 713 of file ExtensionFunctions.hpp.
EXTENSION_NOINLINE float reg_hex_horiz_pixel_bin_x | ( | const double | valx, |
const double | minx, | ||
const double | maxx, | ||
const double | valy, | ||
const double | miny, | ||
const double | maxy, | ||
const double | hexwidth, | ||
const double | hexheight, | ||
const double | offsetx, | ||
const double | offsety, | ||
const int32_t | imgwidth, | ||
const int32_t | imgheight | ||
) |
Definition at line 561 of file ExtensionFunctions.hpp.
EXTENSION_NOINLINE float reg_hex_horiz_pixel_bin_y | ( | const double | valx, |
const double | minx, | ||
const double | maxx, | ||
const double | valy, | ||
const double | miny, | ||
const double | maxy, | ||
const double | hexwidth, | ||
const double | hexheight, | ||
const double | offsetx, | ||
const double | offsety, | ||
const int32_t | imgwidth, | ||
const int32_t | imgheight | ||
) |
Definition at line 639 of file ExtensionFunctions.hpp.
EXTENSION_NOINLINE int32_t reg_hex_vert_pixel_bin_packed | ( | const double | valx, |
const double | minx, | ||
const double | maxx, | ||
const double | valy, | ||
const double | miny, | ||
const double | maxy, | ||
const double | hexwidth, | ||
const double | hexheight, | ||
const double | offsetx, | ||
const double | offsety, | ||
const int32_t | imgwidth, | ||
const int32_t | imgheight | ||
) |
Definition at line 945 of file ExtensionFunctions.hpp.
EXTENSION_NOINLINE float reg_hex_vert_pixel_bin_x | ( | const double | valx, |
const double | minx, | ||
const double | maxx, | ||
const double | valy, | ||
const double | miny, | ||
const double | maxy, | ||
const double | hexwidth, | ||
const double | hexheight, | ||
const double | offsetx, | ||
const double | offsety, | ||
const int32_t | imgwidth, | ||
const int32_t | imgheight | ||
) |
Definition at line 795 of file ExtensionFunctions.hpp.
EXTENSION_NOINLINE float reg_hex_vert_pixel_bin_y | ( | const double | valx, |
const double | minx, | ||
const double | maxx, | ||
const double | valy, | ||
const double | miny, | ||
const double | maxy, | ||
const double | hexwidth, | ||
const double | hexheight, | ||
const double | offsetx, | ||
const double | offsety, | ||
const int32_t | imgwidth, | ||
const int32_t | imgheight | ||
) |
Definition at line 869 of file ExtensionFunctions.hpp.
EXTENSION_NOINLINE double Round | ( | const double | x, |
const int32_t | y | ||
) |
Definition at line 177 of file ExtensionFunctions.hpp.
EXTENSION_NOINLINE double Round2_to_digit | ( | const double | x, |
const int32_t | y | ||
) |
Definition at line 279 of file ExtensionFunctions.hpp.
EXTENSION_NOINLINE float Round__ | ( | const float | x, |
const int32_t | y | ||
) |
Definition at line 191 of file ExtensionFunctions.hpp.
EXTENSION_NOINLINE int16_t Round__1 | ( | const int16_t | x, |
const int32_t | y | ||
) |
Definition at line 205 of file ExtensionFunctions.hpp.
EXTENSION_NOINLINE int32_t Round__2 | ( | const int32_t | x, |
const int32_t | y | ||
) |
Definition at line 226 of file ExtensionFunctions.hpp.
EXTENSION_NOINLINE int64_t Round__3 | ( | const int64_t | x, |
const int32_t | y | ||
) |
Definition at line 247 of file ExtensionFunctions.hpp.
EXTENSION_NOINLINE int64_t Round__4 | ( | const int64_t | x, |
const int32_t | y0, | ||
const int32_t | scale | ||
) |
Definition at line 262 of file ExtensionFunctions.hpp.
EXTENSION_NOINLINE double round_to_digit | ( | const double | x, |
const int32_t | y | ||
) |
Definition at line 285 of file ExtensionFunctions.hpp.
EXTENSION_NOINLINE double Sin | ( | const double | x | ) |
Definition at line 291 of file ExtensionFunctions.hpp.
EXTENSION_NOINLINE double Tan | ( | const double | x | ) |
Definition at line 296 of file ExtensionFunctions.hpp.
EXTENSION_NOINLINE double Tan__ | ( | const float | x | ) |
Definition at line 301 of file ExtensionFunctions.hpp.
EXTENSION_NOINLINE double Truncate | ( | const double | x, |
const int32_t | y | ||
) |
Definition at line 306 of file ExtensionFunctions.hpp.
Referenced by com.mapd.calcite.parser.MapDSqlOperatorTable::addUDF().
EXTENSION_NOINLINE float Truncate__ | ( | const float | x, |
const int32_t | y | ||
) |
Definition at line 313 of file ExtensionFunctions.hpp.
EXTENSION_NOINLINE int16_t Truncate__1 | ( | const int16_t | x, |
const int32_t | y | ||
) |
Definition at line 320 of file ExtensionFunctions.hpp.
EXTENSION_NOINLINE int32_t Truncate__2 | ( | const int32_t | x, |
const int32_t | y | ||
) |
Definition at line 337 of file ExtensionFunctions.hpp.
EXTENSION_NOINLINE int64_t Truncate__3 | ( | const int64_t | x, |
const int32_t | y | ||
) |
Definition at line 347 of file ExtensionFunctions.hpp.