22 const bool is_fill_agg) {
23 const auto upper_agg_type_str =
to_upper(agg_type_str);
24 const static std::map<std::string, RasterAggType> agg_type_map = {
32 const auto itr = agg_type_map.find(upper_agg_type_str);
33 if (itr == agg_type_map.end()) {
47 const int64_t kernel_size = fill_radius * 2 + 1;
48 std::vector<double> gaussian_kernel(kernel_size);
49 const double expr = 1.0 / (sigma * sqrt(2.0 *
M_PI));
50 for (int64_t kernel_idx = -fill_radius; kernel_idx <= fill_radius; ++kernel_idx) {
51 gaussian_kernel[kernel_idx + fill_radius] =
52 expr * exp((kernel_idx * kernel_idx) / (-2.0 * (sigma * sigma)));
54 return gaussian_kernel;
RasterAggType get_raster_agg_type(const std::string &agg_type_str, const bool is_fill_agg)
std::vector< double > generate_1d_gaussian_kernel(const int64_t fill_radius, double sigma)