|
@@ -284,6 +284,7 @@ int main(int argc, char **argv)
|
|
|
G_create_alt_env();
|
|
|
G_setenv_nogisrc("GISDBASE", indbase->answer ? indbase->answer : G_gisdbase());
|
|
|
G_setenv_nogisrc("LOCATION_NAME", inlocation->answer);
|
|
|
+ G_setenv_nogisrc("MAPSET", setname);
|
|
|
|
|
|
permissions = G_mapset_permissions(setname);
|
|
|
if (permissions < 0) /* can't access mapset */
|
|
@@ -338,6 +339,9 @@ int main(int argc, char **argv)
|
|
|
tproj.def = G_store(pipeline->answer);
|
|
|
}
|
|
|
#endif
|
|
|
+
|
|
|
+ /* switch back to current location */
|
|
|
+ G_switch_env();
|
|
|
if (GPJ_init_transform(&iproj, &oproj, &tproj) < 0)
|
|
|
G_fatal_error(_("Unable to initialize coordinate transformation"));
|
|
|
|
|
@@ -348,6 +352,9 @@ int main(int argc, char **argv)
|
|
|
if (G_verbose() > G_verbose_std())
|
|
|
pj_print_proj_params(&iproj, &oproj);
|
|
|
|
|
|
+ /* switch to input location */
|
|
|
+ G_switch_env();
|
|
|
+
|
|
|
/* this call causes r.proj to read the entire map into memeory */
|
|
|
Rast_get_cellhd(inmap->answer, setname, &incellhd);
|
|
|
|