Skip to content
Snippets Groups Projects
Commit 0a063438 authored by Andreas Gattringer's avatar Andreas Gattringer
Browse files

apply filename pattern substition to overlays

parent 0a2d167e
No related branches found
No related tags found
No related merge requests found
//
// Created by andreas on 08/02/23.
//
#include <assert.h>
#include <math.h>
#include "overlay_resources.h"
......
......@@ -34,7 +34,7 @@
#include "overlay_habitat_type_cc.h"
#include "overlay_exclusion.h"
#include "overlay_resources.h"
#include "paths/path_patterns.h"
const char *get_overlay_name(enum overlay_type type)
{
......@@ -139,7 +139,9 @@ void load_overlay_from_file(struct cats_configuration *conf, enum overlay_type t
log_message(LOG_ERROR, "overlay type %d out of range", type);
}
log_message(LOG_INFO, "gdal: loading grid mask %s", filename);
struct cats_2d_array_double *raw_values = get_double_values_from_gdal(&conf->geometry, filename, false, false);
char *filename_substituted = filename_pattern_substitution(filename, conf, conf->time.year_current);
struct cats_2d_array_double *raw_values = get_double_values_from_gdal(&conf->geometry, filename_substituted, false, false);
check_raster_dimensions(raw_values->dimension, conf->geometry.dimension);
......@@ -168,6 +170,6 @@ void load_overlay_from_file(struct cats_configuration *conf, enum overlay_type t
break;
}
free(filename_substituted);
free_cats_grid(&raw_values);
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment