Skip to content

Commit

Permalink
add check if datasets have at least one raster band [#92]
Browse files Browse the repository at this point in the history
  • Loading branch information
appelmar committed Feb 2, 2024
1 parent 6cd2624 commit dd9f19a
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/gdalcubes/src/image_collection_cube.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,12 @@ std::shared_ptr<chunk_data> image_collection_cube::read_chunk(chunkid_t id) {
std::string bandsel_vrt_name = "";
GDALDataset *g = (GDALDataset *)GDALOpen(it->first.c_str(), GA_ReadOnly);
if (!g) {
GCBS_WARN("GDAL cannot open '" + it->first + "', image will be ignored");
GCBS_WARN("GDAL cannot open '" + it->first + "', image will be ignored.");
continue;
}

if (g->GetRasterCount() == 0) {
GCBS_WARN("GDAL dataset'" + it->first + "' does not contain any raster bands and will be ignored.");
continue;
}

Expand Down

0 comments on commit dd9f19a

Please sign in to comment.