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

r.in.gdal: after renaming to project use CRS instead of projection #3578

Merged
merged 1 commit into from
Apr 11, 2024
Merged
Show file tree
Hide file tree
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
22 changes: 9 additions & 13 deletions raster/r.in.gdal/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ int main(int argc, char *argv[])
parm.target->required = NO;
parm.target->label = _("Name of GCPs target project (location)");
parm.target->description = _("Name of project to create or to read "
"projection from for GCPs transformation");
"CRS from for GCPs transformation");
parm.target->key_desc = "name";
parm.target->guisection = _("Projection");

Expand Down Expand Up @@ -213,10 +213,9 @@ int main(int argc, char *argv[])

flag_o = G_define_flag();
flag_o->key = 'o';
flag_o->label =
_("Override projection check (use current project's projection)");
flag_o->description =
_("Assume that the dataset has same projection as the current project");
flag_o->label = _("Override projection check (use current project's CRS)");
flag_o->description = _("Assume that the dataset has the same coordinate "
"reference system as the current project");
flag_o->guisection = _("Projection");

flag_j = G_define_flag();
Expand Down Expand Up @@ -977,9 +976,8 @@ int main(int argc, char *argv[])
/* create target location */
if (!hSRS || GPJ_osr_to_grass(&gcpcellhd, &proj_info,
&proj_units, hSRS, 0) == 1) {
G_warning(
_("Unable to convert input map projection to GRASS "
"format; cannot create new project."));
G_warning(_("Unable to convert input map CRS to GRASS "
"format; cannot create new project."));
}
else {
const char *authkey, *authname, *authcode;
Expand Down Expand Up @@ -1133,13 +1131,11 @@ static void SetupReprojector(const char *pszSrcWKT, const char *pszDstLoc,

/* Get projection info from target location */
if ((out_proj_info = G_get_projinfo()) == NULL)
G_fatal_error(_("Unable to get projection info of target project"));
G_fatal_error(_("Unable to get CRS info of target project"));
if ((out_unit_info = G_get_projunits()) == NULL)
G_fatal_error(
_("Unable to get projection units of target project"));
G_fatal_error(_("Unable to get CRS units of target project"));
if (pj_get_kv(oproj, out_proj_info, out_unit_info) < 0)
G_fatal_error(
_("Unable to get projection key values of target project"));
G_fatal_error(_("Unable to get CRS key values of target project"));
tproj->def = NULL;
if (GPJ_init_transform(iproj, oproj, tproj) < 0)
G_fatal_error(_("Unable to initialize coordinate transformation"));
Expand Down
13 changes: 7 additions & 6 deletions raster/r.in.gdal/proj.c
Original file line number Diff line number Diff line change
Expand Up @@ -196,8 +196,9 @@ void check_projection(struct Cell_head *cellhd, GDALDatasetH hDS, char *outloc,
proj_info, proj_units)) != 1) {
int i_value;

strcpy(error_msg, _("Projection of dataset does not"
" appear to match current project.\n\n"));
strcpy(error_msg,
_("Coordinate reference system of dataset does not"
" appear to match current project.\n\n"));

/* TODO: output this info sorted by key: */
if (loc_wind.proj != cellhd->proj || err != -2) {
Expand Down Expand Up @@ -320,10 +321,10 @@ void check_projection(struct Cell_head *cellhd, GDALDatasetH hDS, char *outloc,
}
if (!check_only) {
strcat(error_msg, _("\nIn case of no significant differences "
"in the projection definitions,"
"in the CRS definitions,"
" use the -o flag to ignore them and use"
" current project definition.\n"));
strcat(error_msg, _("Consider generating a new location from "
strcat(error_msg, _("Consider generating a new project from "
"the input dataset using "
"the 'project' parameter.\n"));
}
Expand All @@ -343,8 +344,8 @@ void check_projection(struct Cell_head *cellhd, GDALDatasetH hDS, char *outloc,
msg_fn = G_message;
else
msg_fn = G_verbose_message;
msg_fn(_("Projection of input dataset and current project "
"appear to match"));
msg_fn(_("Coordinate reference system of input dataset and current "
"project appear to match"));
if (check_only) {
GDALClose(hDS);
exit(EXIT_SUCCESS);
Expand Down
4 changes: 2 additions & 2 deletions scripts/r.import/r.import.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,8 @@
# %end
# %flag
# % key: o
# % label: Override projection check (use current project's projection)
# % description: Assume that the dataset has the same projection as the current project
# % label: Override projection check (use current project's CRS)
# % description: Assume that the dataset has the same coordinate reference system (CRS) as the current project
# %end
# %rules
# % required: output,-e
Expand Down
Loading