mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-09-21 09:10:48 +00:00
h3ToGeo - fixes to code
This commit is contained in:
parent
1284a04a8b
commit
cabd4144da
@ -24,8 +24,6 @@ namespace DB
|
||||
namespace ErrorCodes
|
||||
{
|
||||
extern const int ILLEGAL_TYPE_OF_ARGUMENT;
|
||||
extern const int ILLEGAL_COLUMN;
|
||||
|
||||
}
|
||||
|
||||
namespace
|
||||
@ -61,13 +59,7 @@ public:
|
||||
{
|
||||
const auto * col_index = arguments[0].column.get();
|
||||
|
||||
auto dst = ColumnVector<Float64>::create();
|
||||
|
||||
auto & dst_data = dst->getData();
|
||||
dst_data.resize(input_rows_count);
|
||||
ColumnPtr res_column;
|
||||
|
||||
|
||||
auto latitude = ColumnFloat64::create(input_rows_count);
|
||||
auto longitude = ColumnFloat64::create(input_rows_count);
|
||||
|
||||
@ -76,13 +68,13 @@ public:
|
||||
|
||||
for (const auto row : ext::range(0, input_rows_count))
|
||||
{
|
||||
const UInt64 h3Index = col_index->getUInt(row);
|
||||
const UInt64 h3index = col_index->getUInt(row);
|
||||
GeoCoord coord;
|
||||
h3ToGeo(h3Index,&coord);
|
||||
h3ToGeo(h3index,&coord);
|
||||
lon_data[row] = radsToDegs(coord.lon);
|
||||
lat_data[row] = radsToDegs(coord.lat);
|
||||
|
||||
}
|
||||
|
||||
MutableColumns result;
|
||||
result.emplace_back(std::move(longitude));
|
||||
result.emplace_back(std::move(latitude));
|
||||
|
@ -7,6 +7,6 @@ INSERT INTO h3_indexes VALUES(644325524701193975);
|
||||
INSERT INTO h3_indexes VALUES(644325524701193976);
|
||||
INSERT INTO h3_indexes VALUES(644325524701193977);
|
||||
|
||||
select h3ToGeo(h3_index) from h3_indexes;
|
||||
select h3ToGeo(h3_index) from h3_indexes order by h3_index;
|
||||
|
||||
DROP TABLE h3_indexes;
|
||||
DROP TABLE h3_indexes;
|
||||
|
Loading…
Reference in New Issue
Block a user