mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-09-20 08:40:50 +00:00
add check for max h3 resolution
This commit is contained in:
parent
e02bd7d785
commit
b50005e702
@ -11,6 +11,7 @@
|
|||||||
#include <Common/typeid_cast.h>
|
#include <Common/typeid_cast.h>
|
||||||
#include <base/range.h>
|
#include <base/range.h>
|
||||||
|
|
||||||
|
#include <constants.h>
|
||||||
#include <h3api.h>
|
#include <h3api.h>
|
||||||
|
|
||||||
|
|
||||||
@ -109,6 +110,14 @@ public:
|
|||||||
const double lat = data_lat[row];
|
const double lat = data_lat[row];
|
||||||
const UInt8 res = data_res[row];
|
const UInt8 res = data_res[row];
|
||||||
|
|
||||||
|
if (res > MAX_H3_RES)
|
||||||
|
throw Exception(
|
||||||
|
ErrorCodes::ARGUMENT_OUT_OF_BOUND,
|
||||||
|
"The argument 'resolution' ({}) of function {} is out of bounds because the maximum resolution in H3 library is ",
|
||||||
|
toString(res),
|
||||||
|
getName(),
|
||||||
|
MAX_H3_RES);
|
||||||
|
|
||||||
LatLng coord;
|
LatLng coord;
|
||||||
coord.lng = degsToRads(lon);
|
coord.lng = degsToRads(lon);
|
||||||
coord.lat = degsToRads(lat);
|
coord.lat = degsToRads(lat);
|
||||||
|
Loading…
Reference in New Issue
Block a user