OmniSciDB
a5dc49c757
|
#include <GeoRasterTableFunctions.hpp>
Public Member Functions | |
template<typename T2 , typename Z2 > | |
GeoRaster (const Column< T2 > &input_x, const Column< T2 > &input_y, const Column< Z2 > &input_z, const RasterAggType raster_agg_type, const double bin_dim_meters, const bool geographic_coords, const bool align_bins_to_zero_based_grid) | |
template<typename T2 , typename Z2 > | |
GeoRaster (const Column< T2 > &input_x, const Column< T2 > &input_y, const ColumnList< Z2 > &input_z_cols, const std::vector< RasterAggType > &raster_agg_types, const double bin_dim_meters, const bool geographic_coords, const bool align_bins_to_zero_based_grid) | |
template<typename T2 , typename Z2 > | |
GeoRaster (const Column< T2 > &input_x, const Column< T2 > &input_y, const Column< Z2 > &input_z, const RasterAggType raster_agg_type, const double bin_dim_meters, const bool geographic_coords, const bool align_bins_to_zero_based_grid, const T x_min, const T x_max, const T y_min, const T y_max) | |
T | get_x_bin (const T input) const |
T | get_y_bin (const T input) const |
bool | is_null (const Z value) const |
bool | is_bin_out_of_bounds (const int64_t x_bin, const int64_t y_bin) const |
std::pair< int64_t, Z > | get_bin_idx_and_z_val_for_xy_bin (const int64_t x_bin, const int64_t y_bin) const |
int64_t | get_bin_idx_for_xy_coords (const T x, const T y) const |
std::pair< T, T > | get_xy_coords_for_bin_idx (const int64_t bin_idx) const |
Z | offset_source_z_from_raster_z (const int64_t source_x_bin, const int64_t source_y_bin, const Z source_z_offset) const |
Z | offset_source_z_from_raster_z (const int64_t source_x_bin, const int64_t source_y_bin, const Z source_z_offset, const int64_t z_col_idx) const |
void | align_bins_max_inclusive () |
void | align_bins_max_exclusive () |
void | calculate_bins_and_scales () |
template<typename T2 , typename Z2 > | |
void | compute (const Column< T2 > &input_x, const Column< T2 > &input_y, const Column< Z2 > &input_z, std::vector< Z > &output_z, const RasterAggType raster_agg_type, const size_t max_inputs_per_thread) |
void | fill_bins_from_neighbors (const int64_t neighborhood_fill_radius, const bool fill_only_nulls, const RasterAggType raster_agg_type=RasterAggType::GAUSS_AVG) |
void | fill_bins_from_neighbors (const int64_t neighborhood_fill_radius, const bool fill_only_nulls, const RasterAggType raster_agg_type, std::vector< Z > &z) |
bool | get_nxn_neighbors_if_not_null (const int64_t x_bin, const int64_t y_bin, const int64_t num_bins_radius, std::vector< Z > &neighboring_bins) const |
std::pair< Z, Z > | calculate_slope_and_aspect_of_cell (const std::vector< Z > &neighboring_cells, const bool compute_slope_in_degrees) const |
void | calculate_slope_and_aspect (Column< Z > &slope, Column< Z > &aspect, const bool compute_slope_in_degrees) const |
int64_t | outputDenseColumns (TableFunctionManager &mgr, Column< T > &output_x, Column< T > &output_y, Column< Z > &output_z, const int64_t band_idx=0) const |
int64_t | outputDenseColumn (TableFunctionManager &mgr, Column< Z > &output_z, const int64_t band_idx) const |
int64_t | outputDenseColumns (TableFunctionManager &mgr, Column< T > &output_x, Column< T > &output_y, Column< Array< Z >> &output_z) const |
int64_t | outputDenseColumnsAndFill (TableFunctionManager &mgr, Column< T > &output_x, Column< T > &output_y, Column< Z > &output_z, const int64_t neighborhood_null_fill_radius) const |
void | setMetadata (TableFunctionManager &mgr) const |
Public Attributes | |
const T | bin_dim_meters_ |
const bool | geographic_coords_ |
const Z | null_sentinel_ |
const bool | is_multi_z_ |
std::vector< Z > | z_ |
std::vector< std::vector< Z > > | z_cols_ |
std::vector< Z > | counts_ |
T | x_min_ |
T | x_max_ {0} |
T | y_min_ {0} |
T | y_max_ {0} |
T | x_range_ {0} |
T | y_range_ {0} |
T | x_meters_per_degree_ {0} |
T | y_meters_per_degree_ {0} |
int64_t | num_x_bins_ {0} |
int64_t | num_y_bins_ {0} |
int64_t | num_bins_ {0} |
T | x_scale_input_to_bin_ {0} |
T | y_scale_input_to_bin_ {0} |
T | x_scale_bin_to_input_ {0} |
T | y_scale_bin_to_input_ {0} |
Static Public Attributes | |
static constexpr int64_t | BIN_OUT_OF_BOUNDS {-1} |
Private Member Functions | |
template<RasterAggType AggType, typename T2 , typename Z2 > | |
void | computeSerialImpl (const Column< T2 > &input_x, const Column< T2 > &input_y, const Column< Z2 > &input_z, std::vector< Z > &output_z) |
template<RasterAggType AggType> | |
void | computeParallelReductionAggImpl (const std::vector< std::vector< Z >> &z_inputs, std::vector< Z > &output_z, const Z agg_sentinel) |
template<RasterAggType AggType, typename T2 , typename Z2 > | |
void | computeParallelImpl (const Column< T2 > &input_x, const Column< T2 > &input_y, const Column< Z2 > &input_z, std::vector< Z > &output_z, const size_t max_inputs_per_thread) |
Z | fill_bin_from_avg_box_neighborhood (const int64_t x_centroid_bin, const int64_t y_centroid_bin, const int64_t bins_radius, std::vector< Z > &z) const |
template<RasterAggType AggType> | |
Z | fill_bin_from_box_neighborhood (const int64_t x_centroid_bin, const int64_t y_centroid_bin, const int64_t bins_radius, const ComputeAgg< AggType > &compute_agg, std::vector< Z > &z) const |
template<RasterAggType AggType> | |
void | fill_bins_from_box_neighborhood (const int64_t neighborhood_fill_radius, const bool fill_only_nulls, std::vector< Z > &z) |
void | fill_bins_from_gaussian_neighborhood (const int64_t neighborhood_fill_radius, const bool fill_only_nulls, std::vector< Z > &z) |
Definition at line 90 of file GeoRasterTableFunctions.hpp.
GeoRaster< T, Z >::GeoRaster | ( | const Column< T2 > & | input_x, |
const Column< T2 > & | input_y, | ||
const Column< Z2 > & | input_z, | ||
const RasterAggType | raster_agg_type, | ||
const double | bin_dim_meters, | ||
const bool | geographic_coords, | ||
const bool | align_bins_to_zero_based_grid | ||
) |
Definition at line 296 of file GeoRasterTableFunctions.hpp.
References GeoRaster< T, Z >::align_bins_max_inclusive(), GeoRaster< T, Z >::calculate_bins_and_scales(), GeoRaster< T, Z >::compute(), DEBUG_TIMER, GeoRaster< T, Z >::geographic_coords_, get_column_min_max(), max_inputs_per_thread, GeoRaster< T, Z >::num_bins_, GeoRaster< T, Z >::num_x_bins_, GeoRaster< T, Z >::num_y_bins_, Column< T >::size(), GeoRaster< T, Z >::x_max_, GeoRaster< T, Z >::x_min_, GeoRaster< T, Z >::y_max_, GeoRaster< T, Z >::y_min_, and GeoRaster< T, Z >::z_.
GeoRaster< T, Z >::GeoRaster | ( | const Column< T2 > & | input_x, |
const Column< T2 > & | input_y, | ||
const ColumnList< Z2 > & | input_z_cols, | ||
const std::vector< RasterAggType > & | raster_agg_types, | ||
const double | bin_dim_meters, | ||
const bool | geographic_coords, | ||
const bool | align_bins_to_zero_based_grid | ||
) |
Definition at line 338 of file GeoRasterTableFunctions.hpp.
References GeoRaster< T, Z >::align_bins_max_inclusive(), GeoRaster< T, Z >::calculate_bins_and_scales(), GeoRaster< T, Z >::compute(), DEBUG_TIMER, GeoRaster< T, Z >::geographic_coords_, get_column_min_max(), max_inputs_per_thread, GeoRaster< T, Z >::num_bins_, GeoRaster< T, Z >::num_x_bins_, GeoRaster< T, Z >::num_y_bins_, ColumnList< T >::numCols(), Column< T >::size(), GeoRaster< T, Z >::x_max_, GeoRaster< T, Z >::x_min_, GeoRaster< T, Z >::y_max_, GeoRaster< T, Z >::y_min_, and GeoRaster< T, Z >::z_cols_.
GeoRaster< T, Z >::GeoRaster | ( | const Column< T2 > & | input_x, |
const Column< T2 > & | input_y, | ||
const Column< Z2 > & | input_z, | ||
const RasterAggType | raster_agg_type, | ||
const double | bin_dim_meters, | ||
const bool | geographic_coords, | ||
const bool | align_bins_to_zero_based_grid, | ||
const T | x_min, | ||
const T | x_max, | ||
const T | y_min, | ||
const T | y_max | ||
) |
Definition at line 395 of file GeoRasterTableFunctions.hpp.
References GeoRaster< T, Z >::align_bins_max_exclusive(), GeoRaster< T, Z >::calculate_bins_and_scales(), GeoRaster< T, Z >::compute(), DEBUG_TIMER, GeoRaster< T, Z >::geographic_coords_, max_inputs_per_thread, and GeoRaster< T, Z >::z_.
void GeoRaster< T, Z >::align_bins_max_exclusive | ( | ) |
Definition at line 469 of file GeoRasterTableFunctions.hpp.
Referenced by GeoRaster< T, Z >::GeoRaster().
void GeoRaster< T, Z >::align_bins_max_inclusive | ( | ) |
Definition at line 459 of file GeoRasterTableFunctions.hpp.
Referenced by GeoRaster< T, Z >::GeoRaster().
void GeoRaster< T, Z >::calculate_bins_and_scales | ( | ) |
Definition at line 477 of file GeoRasterTableFunctions.hpp.
References CHECK_GT, distance_in_meters(), heavydb.dtypes::T, and to_string().
Referenced by GeoRaster< T, Z >::GeoRaster().
void GeoRaster< T, Z >::calculate_slope_and_aspect | ( | Column< Z > & | slope, |
Column< Z > & | aspect, | ||
const bool | compute_slope_in_degrees | ||
) | const |
Definition at line 1020 of file GeoRasterTableFunctions.hpp.
References CHECK_EQ, DEBUG_TIMER, threading_serial::parallel_for(), Column< T >::setNull(), Column< T >::size(), and x_y_bin_to_bin_index().
Referenced by tf_geo_rasterize_slope__cpu_template().
|
inline |
Definition at line 993 of file GeoRasterTableFunctions.hpp.
References math_consts::radians_to_degrees.
void GeoRaster< T, Z >::compute | ( | const Column< T2 > & | input_x, |
const Column< T2 > & | input_y, | ||
const Column< Z2 > & | input_z, | ||
std::vector< Z > & | output_z, | ||
const RasterAggType | raster_agg_type, | ||
const size_t | max_inputs_per_thread | ||
) |
Definition at line 663 of file GeoRasterTableFunctions.hpp.
References AVG, CHECK, COUNT, MAX, max_inputs_per_thread, MIN, threading_serial::parallel_for(), and SUM.
Referenced by GeoRaster< T, Z >::GeoRaster().
|
private |
Definition at line 589 of file GeoRasterTableFunctions.hpp.
References COUNT, DEBUG_TIMER, max_temp_output_entries, MIN, threading_serial::parallel_for(), Column< T >::size(), and x_y_bin_to_bin_index().
|
private |
Definition at line 556 of file GeoRasterTableFunctions.hpp.
References threading_serial::parallel_for().
|
private |
Definition at line 522 of file GeoRasterTableFunctions.hpp.
References DEBUG_TIMER, MIN, Column< T >::size(), and x_y_bin_to_bin_index().
|
inlineprivate |
Definition at line 717 of file GeoRasterTableFunctions.hpp.
References x_y_bin_to_bin_index().
|
inlineprivate |
Definition at line 846 of file GeoRasterTableFunctions.hpp.
References MIN, and x_y_bin_to_bin_index().
|
private |
Definition at line 872 of file GeoRasterTableFunctions.hpp.
References AVG, BOX_AVG, CHECK, GAUSS_AVG, INVALID, threading_serial::parallel_for(), and x_y_bin_to_bin_index().
|
private |
Definition at line 745 of file GeoRasterTableFunctions.hpp.
References generate_1d_gaussian_kernel(), threading_serial::parallel_for(), and x_y_bin_to_bin_index().
void GeoRaster< T, Z >::fill_bins_from_neighbors | ( | const int64_t | neighborhood_fill_radius, |
const bool | fill_only_nulls, | ||
const RasterAggType | raster_agg_type = RasterAggType::GAUSS_AVG |
||
) |
Definition at line 907 of file GeoRasterTableFunctions.hpp.
Referenced by geo_rasterize_impl(), tf_geo_multi_rasterize__cpu_template(), tf_geo_rasterize__cpu_template(), and tf_geo_rasterize_slope__cpu_template().
void GeoRaster< T, Z >::fill_bins_from_neighbors | ( | const int64_t | neighborhood_fill_radius, |
const bool | fill_only_nulls, | ||
const RasterAggType | raster_agg_type, | ||
std::vector< Z > & | z | ||
) |
Definition at line 915 of file GeoRasterTableFunctions.hpp.
References AVG, BOX_AVG, COUNT, DEBUG_TIMER, GAUSS_AVG, MAX, MIN, SUM, and UNREACHABLE.
|
inline |
Definition at line 161 of file GeoRasterTableFunctions.hpp.
References GeoRaster< T, Z >::BIN_OUT_OF_BOUNDS, GeoRaster< T, Z >::is_bin_out_of_bounds(), GeoRaster< T, Z >::null_sentinel_, GeoRaster< T, Z >::num_x_bins_, x_y_bin_to_bin_index(), and GeoRaster< T, Z >::z_.
|
inline |
Definition at line 171 of file GeoRasterTableFunctions.hpp.
References GeoRaster< T, Z >::BIN_OUT_OF_BOUNDS, GeoRaster< T, Z >::get_x_bin(), GeoRaster< T, Z >::get_y_bin(), GeoRaster< T, Z >::num_x_bins_, GeoRaster< T, Z >::x_max_, x_y_bin_to_bin_index(), and GeoRaster< T, Z >::y_max_.
bool GeoRaster< T, Z >::get_nxn_neighbors_if_not_null | ( | const int64_t | x_bin, |
const int64_t | y_bin, | ||
const int64_t | num_bins_radius, | ||
std::vector< Z > & | neighboring_bins | ||
) | const |
Definition at line 964 of file GeoRasterTableFunctions.hpp.
References CHECK_EQ, and x_y_bin_to_bin_index().
|
inline |
Definition at line 147 of file GeoRasterTableFunctions.hpp.
References GeoRaster< T, Z >::x_min_, and GeoRaster< T, Z >::x_scale_input_to_bin_.
Referenced by GeoRaster< T, Z >::get_bin_idx_for_xy_coords().
|
inline |
Definition at line 178 of file GeoRasterTableFunctions.hpp.
References bin_to_x_y_bin_indexes(), GeoRaster< T, Z >::num_x_bins_, heavydb.dtypes::T, GeoRaster< T, Z >::x_min_, GeoRaster< T, Z >::x_scale_bin_to_input_, GeoRaster< T, Z >::y_min_, and GeoRaster< T, Z >::y_scale_bin_to_input_.
|
inline |
Definition at line 151 of file GeoRasterTableFunctions.hpp.
References GeoRaster< T, Z >::y_min_, and GeoRaster< T, Z >::y_scale_input_to_bin_.
Referenced by GeoRaster< T, Z >::get_bin_idx_for_xy_coords().
|
inline |
Definition at line 157 of file GeoRasterTableFunctions.hpp.
References GeoRaster< T, Z >::num_x_bins_, and GeoRaster< T, Z >::num_y_bins_.
Referenced by GeoRaster< T, Z >::get_bin_idx_and_z_val_for_xy_bin().
|
inline |
Definition at line 155 of file GeoRasterTableFunctions.hpp.
References GeoRaster< T, Z >::null_sentinel_.
|
inline |
Definition at line 429 of file GeoRasterTableFunctions.hpp.
References x_y_bin_to_bin_index().
|
inline |
Definition at line 443 of file GeoRasterTableFunctions.hpp.
References x_y_bin_to_bin_index().
int64_t GeoRaster< T, Z >::outputDenseColumn | ( | TableFunctionManager & | mgr, |
Column< Z > & | output_z, | ||
const int64_t | band_idx | ||
) | const |
Definition at line 1120 of file GeoRasterTableFunctions.hpp.
References DEBUG_TIMER, threading_serial::parallel_for(), Column< T >::setNull(), and x_y_bin_to_bin_index().
int64_t GeoRaster< T, Z >::outputDenseColumns | ( | TableFunctionManager & | mgr, |
Column< T > & | output_x, | ||
Column< T > & | output_y, | ||
Column< Z > & | output_z, | ||
const int64_t | band_idx = 0 |
||
) | const |
Definition at line 1090 of file GeoRasterTableFunctions.hpp.
References DEBUG_TIMER, threading_serial::parallel_for(), TableFunctionManager::set_output_row_size(), Column< T >::setNull(), and x_y_bin_to_bin_index().
Referenced by geo_rasterize_impl(), tf_geo_multi_rasterize__cpu_template(), tf_geo_rasterize__cpu_template(), and tf_geo_rasterize_slope__cpu_template().
int64_t GeoRaster< T, Z >::outputDenseColumns | ( | TableFunctionManager & | mgr, |
Column< T > & | output_x, | ||
Column< T > & | output_y, | ||
Column< Array< Z >> & | output_z | ||
) | const |
Definition at line 1171 of file GeoRasterTableFunctions.hpp.
References DEBUG_TIMER, TableFunctionManager::set_output_array_values_total_number(), TableFunctionManager::set_output_row_size(), and x_y_bin_to_bin_index().
int64_t GeoRaster< T, Z >::outputDenseColumnsAndFill | ( | TableFunctionManager & | mgr, |
Column< T > & | output_x, | ||
Column< T > & | output_y, | ||
Column< Z > & | output_z, | ||
const int64_t | neighborhood_null_fill_radius | ||
) | const |
Definition at line 1054 of file GeoRasterTableFunctions.hpp.
References DEBUG_TIMER, threading_serial::parallel_for(), TableFunctionManager::set_output_row_size(), Column< T >::setNull(), and x_y_bin_to_bin_index().
void GeoRaster< T, Z >::setMetadata | ( | TableFunctionManager & | mgr | ) | const |
Definition at line 1197 of file GeoRasterTableFunctions.hpp.
References TableFunctionManager::set_metadata().
Referenced by geo_rasterize_impl(), tf_geo_multi_rasterize__cpu_template(), tf_geo_rasterize__cpu_template(), and tf_geo_rasterize_slope__cpu_template().
const T GeoRaster< T, Z >::bin_dim_meters_ |
Definition at line 91 of file GeoRasterTableFunctions.hpp.
|
static |
Definition at line 114 of file GeoRasterTableFunctions.hpp.
Referenced by GeoRaster< T, Z >::get_bin_idx_and_z_val_for_xy_bin(), and GeoRaster< T, Z >::get_bin_idx_for_xy_coords().
std::vector<Z> GeoRaster< T, Z >::counts_ |
Definition at line 97 of file GeoRasterTableFunctions.hpp.
const bool GeoRaster< T, Z >::geographic_coords_ |
Definition at line 92 of file GeoRasterTableFunctions.hpp.
Referenced by GeoRaster< T, Z >::GeoRaster().
const bool GeoRaster< T, Z >::is_multi_z_ |
Definition at line 94 of file GeoRasterTableFunctions.hpp.
const Z GeoRaster< T, Z >::null_sentinel_ |
Definition at line 93 of file GeoRasterTableFunctions.hpp.
Referenced by GeoRaster< T, Z >::get_bin_idx_and_z_val_for_xy_bin(), and GeoRaster< T, Z >::is_null().
int64_t GeoRaster< T, Z >::num_bins_ {0} |
Definition at line 108 of file GeoRasterTableFunctions.hpp.
Referenced by GeoRaster< T, Z >::GeoRaster().
int64_t GeoRaster< T, Z >::num_x_bins_ {0} |
Definition at line 106 of file GeoRasterTableFunctions.hpp.
Referenced by GeoRaster< T, Z >::GeoRaster(), GeoRaster< T, Z >::get_bin_idx_and_z_val_for_xy_bin(), GeoRaster< T, Z >::get_bin_idx_for_xy_coords(), GeoRaster< T, Z >::get_xy_coords_for_bin_idx(), and GeoRaster< T, Z >::is_bin_out_of_bounds().
int64_t GeoRaster< T, Z >::num_y_bins_ {0} |
Definition at line 107 of file GeoRasterTableFunctions.hpp.
Referenced by GeoRaster< T, Z >::GeoRaster(), and GeoRaster< T, Z >::is_bin_out_of_bounds().
T GeoRaster< T, Z >::x_max_ {0} |
Definition at line 99 of file GeoRasterTableFunctions.hpp.
Referenced by GeoRaster< T, Z >::GeoRaster(), and GeoRaster< T, Z >::get_bin_idx_for_xy_coords().
T GeoRaster< T, Z >::x_meters_per_degree_ {0} |
Definition at line 104 of file GeoRasterTableFunctions.hpp.
T GeoRaster< T, Z >::x_min_ |
Definition at line 98 of file GeoRasterTableFunctions.hpp.
Referenced by GeoRaster< T, Z >::GeoRaster(), GeoRaster< T, Z >::get_x_bin(), and GeoRaster< T, Z >::get_xy_coords_for_bin_idx().
T GeoRaster< T, Z >::x_range_ {0} |
Definition at line 102 of file GeoRasterTableFunctions.hpp.
T GeoRaster< T, Z >::x_scale_bin_to_input_ {0} |
Definition at line 111 of file GeoRasterTableFunctions.hpp.
Referenced by GeoRaster< T, Z >::get_xy_coords_for_bin_idx().
T GeoRaster< T, Z >::x_scale_input_to_bin_ {0} |
Definition at line 109 of file GeoRasterTableFunctions.hpp.
Referenced by GeoRaster< T, Z >::get_x_bin().
T GeoRaster< T, Z >::y_max_ {0} |
Definition at line 101 of file GeoRasterTableFunctions.hpp.
Referenced by GeoRaster< T, Z >::GeoRaster(), and GeoRaster< T, Z >::get_bin_idx_for_xy_coords().
T GeoRaster< T, Z >::y_meters_per_degree_ {0} |
Definition at line 105 of file GeoRasterTableFunctions.hpp.
T GeoRaster< T, Z >::y_min_ {0} |
Definition at line 100 of file GeoRasterTableFunctions.hpp.
Referenced by GeoRaster< T, Z >::GeoRaster(), GeoRaster< T, Z >::get_xy_coords_for_bin_idx(), and GeoRaster< T, Z >::get_y_bin().
T GeoRaster< T, Z >::y_range_ {0} |
Definition at line 103 of file GeoRasterTableFunctions.hpp.
T GeoRaster< T, Z >::y_scale_bin_to_input_ {0} |
Definition at line 112 of file GeoRasterTableFunctions.hpp.
Referenced by GeoRaster< T, Z >::get_xy_coords_for_bin_idx().
T GeoRaster< T, Z >::y_scale_input_to_bin_ {0} |
Definition at line 110 of file GeoRasterTableFunctions.hpp.
Referenced by GeoRaster< T, Z >::get_y_bin().
std::vector<Z> GeoRaster< T, Z >::z_ |
Definition at line 95 of file GeoRasterTableFunctions.hpp.
Referenced by GeoRaster< T, Z >::GeoRaster(), and GeoRaster< T, Z >::get_bin_idx_and_z_val_for_xy_bin().
std::vector<std::vector<Z> > GeoRaster< T, Z >::z_cols_ |
Definition at line 96 of file GeoRasterTableFunctions.hpp.
Referenced by GeoRaster< T, Z >::GeoRaster(), and tf_geo_multi_rasterize__cpu_template().