Skip to content

Commit

Permalink
GDAL/OGR import: check projection of input data (#317)
Browse files Browse the repository at this point in the history
ERROR: XXX -> Difference in: XXX

change warning to message in case of just checking
  • Loading branch information
metzm committed Jan 30, 2020
1 parent 410cdbd commit b3604ba
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 39 deletions.
24 changes: 12 additions & 12 deletions raster/r.external/proj.c
Expand Up @@ -193,10 +193,10 @@ void check_projection(struct Cell_head *cellhd, GDALDatasetH hDS,
cellhd->proj, cellhd->zone);
}
if (loc_wind.proj != cellhd->proj) {
strcat(error_msg, "\nERROR: proj\n");
strcat(error_msg, "\nDifference in: proj\n");
}
else {
strcat(error_msg, "\nERROR: ");
strcat(error_msg, "\nDifference in: ");
switch (err) {
case -1:
strcat(error_msg, "proj\n");
Expand Down Expand Up @@ -255,17 +255,17 @@ void check_projection(struct Cell_head *cellhd, GDALDatasetH hDS,
}
}
if (!check_only) {
strcat(error_msg,
_("\nIn case of no significant differences in the projection definitions,"
" use the -o flag to ignore them and use"
" current location definition.\n"));
strcat(error_msg,
_("Consider generating a new location from the input dataset using "
"the 'location' parameter.\n"));
}

strcat(error_msg,
_("\nIn case of no significant differences in the projection definitions,"
" use the -o flag to ignore them and use"
" current location definition.\n"));
strcat(error_msg,
_("Consider generating a new location from the input dataset using "
"the 'location' parameter.\n"));
}
if (check_only)
msg_fn = G_warning;
msg_fn = G_message;
else
msg_fn = G_fatal_error;
msg_fn("%s", error_msg);
Expand Down
6 changes: 3 additions & 3 deletions raster/r.in.gdal/proj.c
Expand Up @@ -193,10 +193,10 @@ void check_projection(struct Cell_head *cellhd, GDALDatasetH hDS,
cellhd->proj, cellhd->zone);
}
if (loc_wind.proj != cellhd->proj) {
strcat(error_msg, "\nERROR: proj\n");
strcat(error_msg, "\nDifference in: proj\n");
}
else {
strcat(error_msg, "\nERROR: ");
strcat(error_msg, "\nDifference in: ");
switch (err) {
case -1:
strcat(error_msg, "proj\n");
Expand Down Expand Up @@ -265,7 +265,7 @@ void check_projection(struct Cell_head *cellhd, GDALDatasetH hDS,
}

if (check_only)
msg_fn = G_warning;
msg_fn = G_message;
else
msg_fn = G_fatal_error;
msg_fn("%s", error_msg);
Expand Down
24 changes: 12 additions & 12 deletions vector/v.external/proj.c
Expand Up @@ -286,10 +286,10 @@ void check_projection(struct Cell_head *cellhd, ds_t hDS, int layer, char *geom_
cellhd->proj, cellhd->zone);
}
if (loc_wind.proj != cellhd->proj) {
strcat(error_msg, "\nERROR: proj\n");
strcat(error_msg, "\nDifference in: proj\n");
}
else {
strcat(error_msg, "\nERROR: ");
strcat(error_msg, "\nDifference in: ");
switch (err) {
case -1:
strcat(error_msg, "proj\n");
Expand Down Expand Up @@ -348,17 +348,17 @@ void check_projection(struct Cell_head *cellhd, ds_t hDS, int layer, char *geom_
}
}
if (!check_only) {
strcat(error_msg,
_("\nIn case of no significant differences in the projection definitions,"
" use the -o flag to ignore them and use"
" current location definition.\n"));
strcat(error_msg,
_("Consider generating a new location from the input dataset using "
"the 'location' parameter.\n"));
}

strcat(error_msg,
_("\nIn case of no significant differences in the projection definitions,"
" use the -o flag to ignore them and use"
" current location definition.\n"));
strcat(error_msg,
_("Consider generating a new location from the input dataset using "
"the 'location' parameter.\n"));
}
if (check_only)
msg_fn = G_warning;
msg_fn = G_message;
else
msg_fn = G_fatal_error;
msg_fn("%s", error_msg);
Expand Down
24 changes: 12 additions & 12 deletions vector/v.in.ogr/proj.c
Expand Up @@ -401,10 +401,10 @@ void check_projection(struct Cell_head *cellhd, ds_t hDS, int layer, char *geom_
cellhd->proj, cellhd->zone);
}
if (loc_wind.proj != cellhd->proj) {
strcat(error_msg, "\nERROR: proj\n");
strcat(error_msg, "\nDifference in: proj\n");
}
else {
strcat(error_msg, "\nERROR: ");
strcat(error_msg, "\nDifference in: ");
switch (err) {
case -1:
strcat(error_msg, "proj\n");
Expand Down Expand Up @@ -463,17 +463,17 @@ void check_projection(struct Cell_head *cellhd, ds_t hDS, int layer, char *geom_
}
}
if (!check_only) {
strcat(error_msg,
_("\nIn case of no significant differences in the projection definitions,"
" use the -o flag to ignore them and use"
" current location definition.\n"));
strcat(error_msg,
_("Consider generating a new location from the input dataset using "
"the 'location' parameter.\n"));
}

strcat(error_msg,
_("\nIn case of no significant differences in the projection definitions,"
" use the -o flag to ignore them and use"
" current location definition.\n"));
strcat(error_msg,
_("Consider generating a new location from the input dataset using "
"the 'location' parameter.\n"));
}
if (check_only)
msg_fn = G_warning;
msg_fn = G_message;
else
msg_fn = G_fatal_error;
msg_fn("%s", error_msg);
Expand Down

0 comments on commit b3604ba

Please sign in to comment.