Skip to content

Commit

Permalink
Merge branch 'main' into enable-md-compilation
Browse files Browse the repository at this point in the history
  • Loading branch information
petrasovaa authored Feb 6, 2025
2 parents 41cb874 + 29009ad commit 3ed9b36
Show file tree
Hide file tree
Showing 38 changed files with 235 additions and 178 deletions.
35 changes: 3 additions & 32 deletions general/g.setproj/g.setproj.html
Original file line number Diff line number Diff line change
@@ -1,32 +1,8 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>g.setproj - GRASS GIS manual</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link rel="stylesheet" href="grassdocs.css" type="text/css">
<meta http-equiv="content-language" content="en-us">
<meta name="viewport" content="width=device-width, initial-scale=1">
</head>
<body bgcolor="white">

<img src="grass_logo.png" alt="GRASS logo"><hr align="center" size="6" noshade>

<h2>NAME</h2>
<h2>DESCRIPTION</h2>

<em><b>g.setproj</b></em> allows the user to create the PROJ_INFO and the
<em>g.setproj</em> allows the user to create the PROJ_INFO and the
PROJ_UNITS files to record the coordinate reference system (CRS) information
associated with a current project (previously called location).
<br>

<h2>SYNOPSIS</h2>

<b>g.setproj</b>

<h2>DESCRIPTION</h2>

Allows a user to create a PROJ_INFO file in the PERMANENT mapset of the
current project. PROJ_INFO file is used to record the CRS information
associated with the specified project.

<h2>NOTES</h2>

Expand Down Expand Up @@ -82,11 +58,6 @@ <h2>SEE ALSO</h2>

<h2>AUTHORS</h2>

Irina Kosinovsky,
U.S. Army Construction Engineering
Research Laboratory<br>
Irina Kosinovsky, U.S. Army Construction Engineering Research Laboratory<br>
Morten Hulden, morten at untamo.net - rewrote module and added 121 projections <br>
Andreas Lange, andreas.lange at rhein-main.de - added prelimnary map datum support

</body>
</html>
3 changes: 2 additions & 1 deletion gui/wxpython/animation/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

from grass.script.utils import parse_key_val
from grass.script import core as gcore
from grass.exceptions import ScriptError

from core.gcmd import GException
from animation.nviztask import NvizTask
Expand Down Expand Up @@ -299,7 +300,7 @@ def SetName(self, name):
try:
name = validateTimeseriesName(name, self._mapType)
self._maps = getRegisteredMaps(name, self._mapType)
except (GException, gcore.ScriptError) as e:
except (GException, ScriptError) as e:
raise ValueError(str(e))
else:
self._maps = validateMapNames(name.split(","), self._mapType)
Expand Down
5 changes: 3 additions & 2 deletions gui/wxpython/animation/dialogs.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
from wx import HyperlinkCtrl

from core.gcmd import GMessage, GError, GException
from grass.exceptions import ScriptError
from core import globalvar
from gui_core.dialogs import MapLayersDialog, GetImageHandlers
from gui_core.preferences import PreferencesBaseDialog
Expand Down Expand Up @@ -1784,7 +1785,7 @@ def _createDefaultCommand(self):
if maps:
mapName, mapLayer = getNameAndLayer(maps[0])
cmd.append("map={name}".format(name=mapName))
except gcore.ScriptError as e:
except ScriptError as e:
GError(parent=self, message=str(e), showTraceback=False)
return None
return cmd
Expand Down Expand Up @@ -1837,7 +1838,7 @@ def _onOK(self, event):
self.layer.name = self._name
self.layer.cmd = self._cmd
event.Skip()
except (GException, gcore.ScriptError) as e:
except (GException, ScriptError) as e:
GError(parent=self, message=str(e))

def GetLayer(self):
Expand Down
3 changes: 1 addition & 2 deletions gui/wxpython/datacatalog/catalog.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
"""

import wx
import os

from pathlib import Path

Expand Down Expand Up @@ -212,7 +211,7 @@ def OnAddGrassDB(self, event):
grassdb_node = self.tree.InsertGrassDb(name=grassdatabase)

# Offer to create a new location
if grassdb_node and not os.listdir(grassdatabase):
if grassdb_node and not any(Path(grassdatabase).iterdir()):
message = _(
"Do you want to create a new project (also known as location)?"
)
Expand Down
3 changes: 2 additions & 1 deletion gui/wxpython/dbmgr/vinfo.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
from core.gcmd import RunCommand, GError
from core.settings import UserSettings
import grass.script as gs
from grass.exceptions import ScriptError


def GetUnicodeValue(value):
Expand Down Expand Up @@ -106,7 +107,7 @@ def SelectByPoint(self, queryCoords, qdist):
coord=(float(queryCoords[0]), float(queryCoords[1])),
distance=float(qdist),
)
except gs.ScriptError:
except ScriptError:
GError(
parent=None,
message=_(
Expand Down
3 changes: 2 additions & 1 deletion gui/wxpython/gui_core/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@

from grass.script import core as grass
from grass.script import task as gtask
from grass.exceptions import ScriptError

from core import globalvar
from gui_core.widgets import (
Expand Down Expand Up @@ -3088,7 +3089,7 @@ def ParseCommand(self, cmd, completed=None):
try:
global _blackList
self.grass_task = gtask.parse_interface(cmd[0], blackList=_blackList)
except (grass.ScriptError, ValueError) as e:
except (ScriptError, ValueError) as e:
raise gcmd.GException(e.value)

# if layer parameters previously set, re-insert them into dialog
Expand Down
3 changes: 2 additions & 1 deletion gui/wxpython/gui_core/vselect.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
from gui_core.wrap import Button, ListCtrl

import grass.script as gs
from grass.exceptions import ScriptError
from grass.pydispatch.signal import Signal


Expand Down Expand Up @@ -302,7 +303,7 @@ def QuerySelectedMap(self):
distance=threshold,
skip_attributes=True,
)
except gs.ScriptError:
except ScriptError:
GError(
parent=self, message=_("Failed to query vector map(s) <%s>.") % self.map
)
Expand Down
4 changes: 2 additions & 2 deletions gui/wxpython/location_wizard/wizard.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
)
from location_wizard.dialogs import SelectTransformDialog

from grass.exceptions import OpenError
from grass.exceptions import OpenError, ScriptError
from grass.grassdb.checks import location_exists
from grass.script import core as grass
from grass.script import decode
Expand Down Expand Up @@ -2739,7 +2739,7 @@ def OnWizFinished(self):
desc=self.startpage.locTitle,
)

except grass.ScriptError as e:
except ScriptError as e:
return e.value

return None
Expand Down
3 changes: 2 additions & 1 deletion gui/wxpython/mapdisp/frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@

import grass.script as gs
from grass.pydispatch.signal import Signal
from grass.exceptions import ScriptError

if TYPE_CHECKING:
import lmgr.frame
Expand Down Expand Up @@ -1103,7 +1104,7 @@ def QueryMap(self, east, north, qdist, rast, vect):
encoding=encoding,
multiple=True,
)
except gs.ScriptError:
except ScriptError:
GError(
parent=self,
message=_(
Expand Down
3 changes: 2 additions & 1 deletion gui/wxpython/psmap/dialogs.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
from wx import PyValidator as Validator

import grass.script as gs
from grass.exceptions import ScriptError
from core.gcmd import GError, GMessage, RunCommand
from core.utils import PilImageToWxImage, cmp
from dbmgr.vinfo import VectorDBInfo
Expand Down Expand Up @@ -2192,7 +2193,7 @@ def __init__(self, parent, id, vectors, tmpSettings):
try:
self.mapDBInfo = VectorDBInfo(self.vectorName)
self.layers = self.mapDBInfo.layers.keys()
except gs.ScriptError:
except ScriptError:
self.connection = False
self.layers = []
if not self.layers:
Expand Down
9 changes: 5 additions & 4 deletions gui/wxpython/psmap/instructions.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
from core.utils import GetCmdString
from dbmgr.vinfo import VectorDBInfo
from grass.script.task import cmdlist_to_tuple
from grass.exceptions import ScriptError
from gui_core.wrap import NewId as wxNewId

from psmap.utils import ( # Add any additional required names from psmap.utils here
Expand Down Expand Up @@ -533,7 +534,7 @@ def SetRegion(self, regionInstruction):
try:
self.env["GRASS_REGION"] = gs.region_env(env=self.env, **cmd[1])

except gs.ScriptError as e:
except ScriptError as e:
GError(_("Region cannot be set\n%s") % e)
return False

Expand Down Expand Up @@ -1910,7 +1911,7 @@ def Read(self, instruction, text):
return False
try:
info = gs.find_file(map, element="cell")
except gs.ScriptError as e:
except ScriptError as e:
GError(message=e.value)
return False
instr["raster"] = info["fullname"]
Expand Down Expand Up @@ -1951,7 +1952,7 @@ def Read(self, instruction, text, **kwargs):
vmap = line.split()[1]
try:
info = gs.find_file(vmap, element="vector")
except gs.ScriptError as e:
except ScriptError as e:
GError(message=e.value)
return False
vmap = info["fullname"]
Expand Down Expand Up @@ -2123,7 +2124,7 @@ def Read(self, instruction, text, **kwargs):
instr = {}
try:
info = gs.find_file(name=text[0].split()[1], element="vector")
except gs.ScriptError as e:
except ScriptError as e:
GError(message=e.value)
return False
instr["name"] = info["fullname"]
Expand Down
7 changes: 4 additions & 3 deletions gui/wxpython/psmap/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
from core.gcmd import GError, RunCommand

import grass.script as gs
from grass.exceptions import ScriptError

try:
from PIL import Image as PILImage # noqa
Expand Down Expand Up @@ -226,7 +227,7 @@ def AutoAdjust(self, scaleType, rect, env, map=None, mapType=None, region=None):
if mapType == "raster":
try:
res = gs.read_command("g.region", flags="gu", raster=map, env=env)
except gs.ScriptError:
except ScriptError:
pass
elif mapType == "vector":
res = gs.read_command("g.region", flags="gu", vector=map, env=env)
Expand All @@ -240,7 +241,7 @@ def AutoAdjust(self, scaleType, rect, env, map=None, mapType=None, region=None):
else:
return None, None, None
# fails after switching location
except (gs.ScriptError, gs.CalledModuleError):
except (ScriptError, gs.CalledModuleError):
pass

if not currRegionDict:
Expand Down Expand Up @@ -390,7 +391,7 @@ def GetMapBounds(filename, env, portrait=True):
.split(","),
)
)
except (gs.ScriptError, IndexError):
except (ScriptError, IndexError):
GError(message=_("Unable to run `ps.map -b`"))
return None
return Rect2D(bb[0], bb[3], bb[2] - bb[0], bb[1] - bb[3])
Expand Down
2 changes: 1 addition & 1 deletion imagery/i.gensigset/i.gensigset.html
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ <h3>Parameters</h3>
and
<em><a href="v.to.rast.html">v.to.rast</a></em>,
or some other import/development process (e.g.,
<em><a href="v.transects.html">v.transects</a>)</em>
<em><a href="https://grass.osgeo.org/grass-stable/manuals/addons/v.transects.html">v.transects</a>)</em>
to define the areas representative of the classes in the image.

<p>
Expand Down
2 changes: 1 addition & 1 deletion imagery/i.landsat.toar/i.landsat.toar.html
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ <h2>DESCRIPTION</h2>
region settings, in order to have the largest possible sample of pixels
from where to get the darkest one of the scene and perform the DOS
correction. To limit the results to a custom region, the user is
advised to clip the results (with <a href="r.clip.html">r.clip</a>, for
advised to clip the results (with <a href="https://grass.osgeo.org/grass-stable/manuals/addons/r.clip.html">r.clip</a>, for
instance) or to define the region first, import the images with region
cropping, and then running the module.

Expand Down
4 changes: 2 additions & 2 deletions imagery/i.ortho.photo/i.ortho.init/i.ortho.init.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ <h2>DESCRIPTION</h2>
include: the (XC,YC,ZC) standard (e.g. UTM) approximate coordinates of the camera exposure
station; initial roll, pitch, and yaw angles (in degrees) of the cameras
attitude; and the <em>a priori</em> standard deviations for these
parameters. During the imagery program, <em>i.photo.rectify</em>, the initial camera
parameters. During the imagery program, <em>i.ortho.rectify</em>, the initial camera
exposure station file is used for computation of the ortho-rectification
parameters. If no initial camera exposure station file exist, the default
values are computed from the control points file created in
Expand Down Expand Up @@ -107,7 +107,7 @@ <h2>SEE ALSO</h2>
<a href="i.ortho.elev.html">i.ortho.elev</a>,
<a href="i.ortho.camera.html">i.ortho.camera</a>,
<a href="i.ortho.transform.html">i.ortho.transform</a>,
<a href="i.photo.rectify.html">i.photo.rectify</a>
<a href="i.ortho.rectify.html">i.ortho.rectify</a>
</em>

<h2>AUTHOR</h2>
Expand Down
10 changes: 5 additions & 5 deletions imagery/i.ortho.photo/i.ortho.rectify/i.ortho.rectify.html
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<h2>DESCRIPTION</h2>

<em>i.photo.rectify</em> rectifies an image by using the image to photo
<em>i.ortho.rectify</em> rectifies an image by using the image to photo
coordinate transformation matrix created by <a href="g.gui.photo2image.html">g.gui.photo2image</a>
and the rectification parameters created by <a href="g.gui.image2target.html">g.gui.image2target</a>.
Rectification is the process by which the geometry of an image is made
planimetric. This is accomplished by mapping an image from one coordinate
system to another. In <em>i.photo.rectify</em> the parameters computed by
system to another. In <em>i.ortho.rectify</em> the parameters computed by
<a href="g.gui.photo2image.html">g.gui.photo2image</a> and
<a href="g.gui.image2target.html">g.gui.image2target</a> are used in equations to
convert x,y image coordinates to standard map coordinates for each pixel in
Expand Down Expand Up @@ -38,7 +38,7 @@ <h2>DESCRIPTION</h2>
areas with high camera angles may also appear blurred if they are located
(viewed from the camera position) behind mountain ridges or peaks.
<p>
<em>i.photo.rectify</em> can be run directly, specifying options in the
<em>i.ortho.rectify</em> can be run directly, specifying options in the
command line or the GUI, or it can be invoked as OPTION 8 through
<a href="i.ortho.photo.html">i.ortho.photo</a>. If invoked though
<a href="i.ortho.photo.html">i.ortho.photo</a>, an interactive terminal
Expand Down Expand Up @@ -70,7 +70,7 @@ <h4>Interactive mode</h4>
<p>
If you choose option 2, you can also specify a desired target resolution.
<p>
<em>i.photo.rectify</em> will only rectify that portion of the
<em>i.ortho.rectify</em> will only rectify that portion of the
image that occurs within the chosen window. Only that portion will be
relocated in the target database. It is therefore important to check the
current window in the target project if choice number one is selected.
Expand All @@ -87,7 +87,7 @@ <h4>Interactive mode</h4>
</pre>
<p>
The last prompt will ask you about the amount of memory to be used by
<em>i.photo.rectify</em>.
<em>i.ortho.rectify</em>.

<h2>SEE ALSO</h2>

Expand Down
2 changes: 1 addition & 1 deletion imagery/i.pca/i.pca.html
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ <h2>SEE ALSO</h2>
<a href="g.gui.iclass.html">g.gui.iclass</a>,
<a href="i.fft.html">i.fft</a>,
<a href="i.ifft.html">i.ifft</a>,
<a href="m.eigensystem.html">m.eigensystem</a>,
<a href="https://grass.osgeo.org/grass-stable/manuals/addons/m.eigensystem.html">m.eigensystem</a>,
<a href="r.covar.html">r.covar</a>,
<a href="r.mapcalc.html">r.mapcalc</a>
<p>
Expand Down
4 changes: 4 additions & 0 deletions lib/vector/Vlib/net_build.c
Original file line number Diff line number Diff line change
Expand Up @@ -666,6 +666,8 @@ int Vect_net_ttb_build_graph(struct Map_info *Map, int ltype, int afield,
dglInitializeSPCache(gr, &(Map->dgraph.spCache));

G_message(_("Graph was built"));
Vect_destroy_field_info(Fi);
db_free_column(Column);
return 0;
}

Expand Down Expand Up @@ -1061,6 +1063,8 @@ int Vect_net_build_graph(struct Map_info *Map, int ltype, int afield,
dglInitializeSPCache(gr, &(Map->dgraph.spCache));

G_message(_("Graph was built"));
Vect_destroy_field_info(Fi);
db_free_column(Column);

return 0;
}
Loading

0 comments on commit 3ed9b36

Please sign in to comment.