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

lib/parser: Use project for G_OPT_M_LOCATION #3130

Merged
Merged
7 changes: 4 additions & 3 deletions general/g.mapset/g.mapset.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<h2>DESCRIPTION</h2>

<em>g.mapset</em> changes the current working MAPSET, LOCATION, or GISDBASE.
<em>g.mapset</em> changes the current working mapset, project (formerly known
as location), or GISDBASE (directory with one or more projects).
This is a fairly radical maneuver to run mid-session, take care when running
the GUI at the same time.
<p>
Expand Down Expand Up @@ -42,7 +43,7 @@ <h3>Change the current mapset</h3>
To change the current mapset to "user1" use the following command:

<div class="code"><pre>
g.mapset mapset=user1 location=nc_spm_08_grass7
g.mapset mapset=user1 project=nc_spm_08_grass7
</pre></div>

You should receive the following message: "Mapset switched. Your shell
Expand All @@ -52,7 +53,7 @@ <h3>Create a new mapset</h3>

To create a new mapset, use the <b>-c</b> tag as shown below:
<div class="code"><pre>
g.mapset -c mapset=new location=nc_spm_08_grass7
g.mapset -c mapset=new project=nc_spm_08_grass7
</pre></div>

<h2>SEE ALSO</h2>
Expand Down
2 changes: 1 addition & 1 deletion general/g.proj/create.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ void create_location(const char *location)
G_fatal_error(_("Unable to create location <%s>"), location);

G_message(_("You can switch to the new location by\n`%s=%s`"),
"g.mapset mapset=PERMANENT location", location);
"g.mapset mapset=PERMANENT project", location);
}

void modify_projinfo(void)
Expand Down
2 changes: 1 addition & 1 deletion gui/wxpython/core/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -602,7 +602,7 @@ def GetListOfMapsets(dbase, location, selectable=False):

if selectable:
ret = RunCommand(
"g.mapset", read=True, flags="l", location=location, dbase=dbase
"g.mapset", read=True, flags="l", project=location, dbase=dbase
)

if not ret:
Expand Down
6 changes: 3 additions & 3 deletions gui/wxpython/datacatalog/dialogs.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ def _estimateResolution(self):
read=True,
input=self.iLayer,
dbase=self.iGisdbase,
location=self.iLocation,
project=self.iLocation,
mapset=self.iMapset,
env=self.oEnv,
).strip()
Expand Down Expand Up @@ -213,7 +213,7 @@ def OnReproject(self, event):
if self.etype == "raster":
cmd.append("r.proj")
cmd.append("dbase=" + self.iGisdbase)
cmd.append("location=" + self.iLocation)
cmd.append("project=" + self.iLocation)
cmd.append("mapset=" + self.iMapset)
cmd.append("input=" + self.iLayer)
cmd.append("output=" + self.oLayer)
Expand All @@ -231,7 +231,7 @@ def OnReproject(self, event):
else:
cmd.append("v.proj")
cmd.append("dbase=" + self.iGisdbase)
cmd.append("location=" + self.iLocation)
cmd.append("project=" + self.iLocation)
cmd.append("mapset=" + self.iMapset)
cmd.append("input=" + self.iLayer)
cmd.append("output=" + self.oLayer)
Expand Down
4 changes: 2 additions & 2 deletions gui/wxpython/gui_core/gselect.py
Original file line number Diff line number Diff line change
Expand Up @@ -2681,7 +2681,7 @@ def UpdateItems(self, dbase, location, mapset):
read=True,
flags="l",
dbase=dbase,
location=location,
project=location,
mapset=mapset,
)
else:
Expand All @@ -2691,7 +2691,7 @@ def UpdateItems(self, dbase, location, mapset):
read=True,
flags="l",
dbase=dbase,
location=location,
project=location,
mapset=mapset,
)
listMaps = list()
Expand Down
2 changes: 1 addition & 1 deletion gui/wxpython/image2target/ii2t_gis_set.py
Original file line number Diff line number Diff line change
Expand Up @@ -909,7 +909,7 @@ def UpdateMapsets(self, location):
"g.mapset",
read=True,
flags="l",
location=locationName,
project=locationName,
gisdbase=self.gisdbase,
)

Expand Down
2 changes: 1 addition & 1 deletion gui/wxpython/lmgr/workspace.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ def _tryToSwitchMapsetFromWorkspaceFile(self, gxwXml):
returncode, errors = RunCommand(
"g.mapset",
dbase=gxwXml.database,
location=gxwXml.location,
project=gxwXml.location,
mapset=gxwXml.mapset,
getErrorMsg=True,
)
Expand Down
4 changes: 2 additions & 2 deletions gui/wxpython/startup/guiutils.py
Original file line number Diff line number Diff line change
Expand Up @@ -681,7 +681,7 @@ def switch_mapset_interactively(
RunCommand(
"g.mapset",
parent=guiparent,
location=location,
project=location,
mapset=mapset,
dbase=dbase,
)
Expand All @@ -702,7 +702,7 @@ def switch_mapset_interactively(
)
elif location:
if (
RunCommand("g.mapset", parent=guiparent, location=location, mapset=mapset)
RunCommand("g.mapset", parent=guiparent, project=location, mapset=mapset)
== 0
):
if show_confirmation:
Expand Down
6 changes: 3 additions & 3 deletions lib/gis/parser_standard_options.c
Original file line number Diff line number Diff line change
Expand Up @@ -694,12 +694,12 @@ struct Option *G_define_standard_option(int opt)
break;

case G_OPT_M_LOCATION:
Opt->key = "location";
Opt->key = "project";
Opt->type = TYPE_STRING;
Opt->required = NO;
Opt->multiple = NO;
Opt->label = _("Location name");
Opt->description = _("Location name (not location path)");
Opt->label = _("Project (location) name");
Opt->description = _("Project name (not path to project)");
Opt->gisprompt = "old,location,location";
Opt->key_desc = "name";
break;
Expand Down
7 changes: 7 additions & 0 deletions lib/gis/renamed_options
Original file line number Diff line number Diff line change
Expand Up @@ -718,3 +718,10 @@ v.what.vect|qvector:query_map
v.what.vect|qlayer:query_layer
v.what.vect|qcolumn:query_column
v.what.vect|vector:map
### Renamed options for location to project rename (8.3->8.4)
#############################################################
g.mapset|location:project
r.proj|location:project
i.ortho.elev|location:project
g.download.location|location:project
v.proj|location:project
wenzeslaus marked this conversation as resolved.
Show resolved Hide resolved
4 changes: 2 additions & 2 deletions python/grass/jupyter/reprojection_renderer.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ def render_raster(self, name):
input=full_name,
output=tgt_name,
mapset=mapset,
location=env_info["LOCATION_NAME"],
project=env_info["LOCATION_NAME"],
dbase=env_info["GISDBASE"],
resolution=self._region_manager.resolution,
env=self._psmerc_env,
Expand Down Expand Up @@ -153,7 +153,7 @@ def render_vector(self, name):
input=name,
output=new_name,
mapset=mapset,
location=env_info["LOCATION_NAME"],
project=env_info["LOCATION_NAME"],
dbase=env_info["GISDBASE"],
env=self._wgs84_env,
)
Expand Down
4 changes: 2 additions & 2 deletions python/grass/temporal/stds_import.py
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ def import_stds(
gscript.run_command(
"g.mapset",
mapset="PERMANENT",
location=location,
project=location,
dbase=old_env["GISDBASE"],
)
except CalledModuleError:
Expand Down Expand Up @@ -601,7 +601,7 @@ def import_stds(
gscript.run_command(
"g.mapset",
mapset=old_env["MAPSET"],
location=old_env["LOCATION_NAME"],
project=old_env["LOCATION_NAME"],
gisdbase=old_env["GISDBASE"],
)
except CalledModuleError:
Expand Down
10 changes: 5 additions & 5 deletions raster/r.proj/r.proj.html
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ <h3>Inline method</h3>

<div class="code"><pre>
# calculate where output map will be
r.proj input=elevation location=ll_wgs84 mapset=user1 -p
petrasovaa marked this conversation as resolved.
Show resolved Hide resolved
r.proj input=elevation project=ll_wgs84 mapset=user1 -p
Source cols: 8162
Source rows: 12277
Local north: -4265502.30382993
Expand All @@ -215,7 +215,7 @@ <h3>Inline method</h3>
Local east: 14409956.2693866

# same calculation, but in a form which can be cut and pasted into a g.region call
r.proj input=elevation location=ll_wgs84 mapset=user1 -g
r.proj input=elevation project=ll_wgs84 mapset=user1 -g
n=-4265502.30382993 s=-4473453.15255565 w=14271663.19157564 e=14409956.2693866 rows=12277 cols=8162

g.region n=-4265502.30382993 s=-4473453.15255565 \
Expand Down Expand Up @@ -251,7 +251,7 @@ <h3>Inline method</h3>
cells: 99535824

# finally, perform the reprojection
r.proj input=elevation location=ll_wgs84 mapset=user1 memory=800
r.proj input=elevation project=ll_wgs84 mapset=user1 memory=800
</pre></div>

<h3>v.in.region method</h3>
Expand All @@ -266,7 +266,7 @@ <h3>v.in.region method</h3>
# Now switch to the target location and import the vector bounding box
# (you can run v.proj -l to get a list of vector maps in the source location):

v.proj input=bounds location=source_location_name output=bounds_reprojected
v.proj input=bounds project=source_location_name output=bounds_reprojected

# Set the region in the target location with that of the newly-imported vector
# bounds map, and align the resolution to the desired cell resolution of the
Expand All @@ -277,7 +277,7 @@ <h3>v.in.region method</h3>
# Now reproject the raster into the target location

r.proj input=elevation.dem output=elevation.dem.reproj \
location=source_location_name mapset=PERMANENT res=5 method=bicubic
project=source_location_name mapset=PERMANENT res=5 method=bicubic
</pre></div>

<h2>REFERENCES</h2>
Expand Down
8 changes: 4 additions & 4 deletions scripts/r.import/r.import.py
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ def main():
if "r" in region_flag:
grass.run_command(
"v.proj",
location=tgtloc,
project=tgtloc,
mapset=tgtmapset,
input=tgtregion,
output=tgtregion,
Expand Down Expand Up @@ -336,7 +336,7 @@ def main():
try:
tgtextents = grass.read_command(
"r.proj",
location=TMPLOC,
project=TMPLOC,
mapset="PERMANENT",
input=outfile,
flags="g",
Expand Down Expand Up @@ -378,7 +378,7 @@ def main():
"v.proj",
input=vreg,
output=vreg,
location=tgtloc,
project=tgtloc,
mapset=tgtmapset,
quiet=True,
env=src_env,
Expand Down Expand Up @@ -445,7 +445,7 @@ def main():
try:
grass.run_command(
"r.proj",
location=TMPLOC,
project=TMPLOC,
mapset="PERMANENT",
input=outfile,
method=method,
Expand Down
4 changes: 2 additions & 2 deletions scripts/v.import/v.import.py
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ def main():
"v.proj",
input=vreg,
output=vreg,
location=tgtloc,
project=tgtloc,
mapset=tgtmapset,
quiet=True,
overwrite=overwrite,
Expand Down Expand Up @@ -378,7 +378,7 @@ def main():
try:
grass.run_command(
"v.proj",
location=TMPLOC,
project=TMPLOC,
mapset="PERMANENT",
input=output,
overwrite=overwrite,
Expand Down
19 changes: 9 additions & 10 deletions vector/v.proj/v.proj.html
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
<h2>DESCRIPTION</h2>

<em>v.proj</em> allows a user to convert a vector map in a specified mapset
of a specified location (different from current) with projection of input
location to the vector map in a current mapset of current location with
projection of current location (both projections are defined by
corresponding PROJ_INFO files). The projection information is taken from the
current PROJ_INFO files, as set and viewed with
of a specified project (different from current) with coordinate reference
system (CRS) of source project to the vector map in a current mapset of current
project with CRS of current project (both CRSs are defined in their
corresponding projects). The CRS information can be viewed and managed with
<em><a href="g.proj.html">g.proj</a></em>.

<p>
For an introduction to map projections (with PROJ),see the manual page of
For an introduction to map CRSs (and the PROJ library), see the manual page of
<a href="r.proj.html">r.proj</a>.

<h2>NOTES</h2>
Expand All @@ -24,7 +23,7 @@ <h2>NOTES</h2>
<br>
If <b>dbase</b> is not specified it is assumed to be the current
database. The user only has to specify <b>dbase</b> if the source
location is stored in another separate GRASS database.
project is stored in another separate GRASS database.

<br>
If <b>smax</b> is set to <b>0</b> the automated vertex densification is
Expand All @@ -34,7 +33,7 @@ <h2>NOTES</h2>
<em>v.proj</em> supports general datum transformations, making use of the
<em>PROJ</em> co-ordinate system translation library.

<p>When projecting into a latlon location, east coordinates are wrapped
<p>When projecting into a latlon project, east coordinates are wrapped
by the proj4 library to fit into the range -180,180. This is in most cases
appropriate, but can cause errors the input vector crosses the datum line
at 180E/W. In this case wrapping of east coordinates to -180,180 needs
Expand All @@ -55,10 +54,10 @@ <h2>NOTES</h2>

<h2>EXAMPLE</h2>

Reprojection of a vector map from another location and mapset into the current mapset:
Reprojection of a vector map from another project (and mapset) into the current mapset:

<div class="code"><pre>
v.proj in=mymap location=latlong mapset=user1
v.proj in=mymap project=latlong mapset=user1
</pre></div>

<h2>REFERENCES</h2>
Expand Down
Loading