Skip to content

Commit

Permalink
gdalinfo: do not emit errors if corner coordinate reprojection fails
Browse files Browse the repository at this point in the history
  • Loading branch information
rouault committed Jan 7, 2024
1 parent 0fb9934 commit fa6ef24
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions apps/gdalinfo_lib.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -742,6 +742,9 @@ char *GDALInfo(GDALDatasetH hDataset, const GDALInfoOptions *psOptions)
/* -------------------------------------------------------------------- */
if (bJson && GDALGetRasterXSize(hDataset))
{
CPLErrorHandlerPusher oErrorHandler(CPLQuietErrorHandler);
CPLErrorStateBackuper oBackuper;

json_object *poLinearRing = json_object_new_array();
json_object *poCornerCoordinates = json_object_new_object();
json_object *poLongLatExtent = json_object_new_object();
Expand Down Expand Up @@ -783,6 +786,9 @@ char *GDALInfo(GDALDatasetH hDataset, const GDALInfoOptions *psOptions)
}
else if (GDALGetRasterXSize(hDataset))
{
CPLErrorHandlerPusher oErrorHandler(CPLQuietErrorHandler);
CPLErrorStateBackuper oBackuper;

Concat(osStr, psOptions->bStdoutOutput, "Corner Coordinates:\n");
GDALInfoReportCorner(psOptions, hDataset, hTransform, "Upper Left", 0.0,
0.0, bJson, nullptr, nullptr, osStr);
Expand Down

0 comments on commit fa6ef24

Please sign in to comment.