Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Convert CPLFailure into Warning on the warped dataset creation #74

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion src/locked_dataset.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ typedef _locale_t locale_t;
#include <gdal.h>
#include <gdal_utils.h>
#include <cpl_conv.h>
#include <cpl_error.h>
#include <ogr_srs_api.h>

#include "types.hpp"
Expand Down Expand Up @@ -700,6 +701,9 @@ class locked_dataset
return; // Lock intentionally not unlocked
}

/* Avoid causing failure in opening file that can't have a Warp object (i.e. some netCDF file) */
/* See https://github.com/geotrellis/gdal-warp-bindings/issues/70 */
CPLTurnFailureIntoWarning(TRUE);
m_datasets[WARPED] = GDALWarp("", nullptr, 1, &m_datasets[SOURCE], app_options, 0);
if (m_datasets[SOURCE] == nullptr)
{
Expand All @@ -708,7 +712,7 @@ class locked_dataset
m_datasets[SOURCE] = m_datasets[WARPED] = nullptr;
return; // Lock intentionally not unlocked
}

CPLTurnFailureIntoWarning(FALSE);
GDALWarpAppOptionsFree(app_options);
}
UNLOCK
Expand Down