Skip to content
Commits on Source (4)
grass (7.8.1~rc2-1~exp1) experimental; urgency=medium
* New upstream release candidate.
-- Bas Couwenberg <sebastic@debian.org> Wed, 06 Nov 2019 13:03:34 +0100
grass (7.8.1~rc1-1~exp1) experimental; urgency=medium
* New upstream release candidate.
......
......@@ -92,7 +92,7 @@ git status
### Update VERSION file to release version number
Directly edit in GH interface:
Directly edit VERSION file in GH interface:
https://github.com/OSGeo/grass/blob/releasebranch_7_8/include/VERSION
......@@ -112,13 +112,20 @@ Example:
### Create release tag
See https://help.github.com/en/articles/creating-releases
(see https://help.github.com/en/articles/creating-releases)
Preparation:
### Changelog and tagging etc
```bash
# update from GH
# assumptions:
# - own fork as "origin"
# - remote repo as "upstream"
git fetch --all --prune && git checkout releasebranch_7_8 && \
git merge upstream/releasebranch_7_8 && git push origin releasebranch_7_8
# create version env var for convenience:
MAJOR=`cat include/VERSION | head -1 | tail -1`
MINOR=`cat include/VERSION | head -2 | tail -1`
......@@ -126,12 +133,7 @@ RELEASE=`cat include/VERSION | head -3 | tail -1`
VERSION=${MAJOR}.${MINOR}.${RELEASE}
echo $VERSION
# Create Changelog file on release branch:
python tools/gitlog2changelog.py
mv ChangeLog ChangeLog_$VERSION
head ChangeLog_$VERSION
gzip ChangeLog_$VERSION
# RELEASETAG variable not really needed any more:
TODAY=`date +"%Y%m%d"`
RELEASETAG=release_${TODAY}_grass_${MAJOR}_${MINOR}_${RELEASE}
echo $RELEASETAG
......@@ -143,7 +145,7 @@ echo $RELEASETAG
echo "$VERSION"
```
Done in GH interface:
To be done in GH interface:
https://github.com/OSGeo/grass/releases/new
......@@ -152,14 +154,6 @@ https://github.com/OSGeo/grass/releases/new
TODO: add checkout of code via release tag (?)
```bash
# update from GH
# assumptions:
# - own fork as "origin"
# - remote repo as "upstream"
git fetch --all --prune && git checkout releasebranch_7_8 && \
git merge upstream/releasebranch_7_8 && git push origin releasebranch_7_8
# create source package (in the source directory):
echo grass-${VERSION}
......@@ -174,9 +168,19 @@ rmdir ./grass-${VERSION}
md5sum grass-${VERSION}.tar.gz > grass-${VERSION}.md5sum
```
Create Changelog file on release branch:
```bash
python tools/gitlog2changelog.py
mv ChangeLog ChangeLog_$VERSION
head ChangeLog_$VERSION
gzip ChangeLog_$VERSION
```
### Reset include/VERSION file to git version:
Directly edit in GH interface:
Directly edit VERSION file in GH interface:
https://github.com/OSGeo/grass/blob/releasebranch_7_8/include/VERSION
......@@ -189,6 +193,16 @@ Example:
2019
```
Reset local copy to GH:
```bash
# update from GH
# assumptions:
# - own fork as "origin"
# - remote repo as "upstream"
git fetch --all --prune && git checkout releasebranch_7_8 && \
git merge upstream/releasebranch_7_8 && git push origin releasebranch_7_8
```
### Upload source code tarball to OSGeo servers
```bash
......
......@@ -773,6 +773,9 @@ def GetDefaultEncoding(forceUTF8=False):
if forceUTF8 and (enc is None or enc == 'UTF8'):
return 'UTF-8'
if enc is None:
enc = locale.getpreferredencoding()
Debug.msg(1, "GetSystemEncoding(): %s" % enc)
return enc
......
......@@ -48,8 +48,6 @@ from gui_core.widgets import GenericValidator, StaticWrapText
from gui_core.wrap import Button, ListCtrl, StaticText, StaticBox, \
TextCtrl
sys.stderr = codecs.getwriter('utf8')(sys.stderr)
class GRASSStartup(wx.Frame):
exit_success = 0
......
......@@ -42,8 +42,6 @@ from gui_core.widgets import GenericValidator, StaticWrapText
from gui_core.wrap import Button, ListCtrl, StaticText, \
StaticBox, TextCtrl
sys.stderr = codecs.getwriter('utf8')(sys.stderr)
class GRASSStartup(wx.Frame):
exit_success = 0
......
......@@ -51,7 +51,7 @@ from core.settings import UserSettings
from grass.script.utils import try_remove
from grass.script import core as grass
from grass.script.task import cmdtuple_to_list
from grass.script.task import cmdtuple_to_list, cmdlist_to_tuple
from grass.pydispatch.signal import Signal
# for standalone app
......@@ -215,23 +215,10 @@ class DMonMap(Map):
classLayer = MapLayer
args['ltype'] = ltype
mapLayer = classLayer(name=name,
cmd=cmd,
Map=None,
hidden=True,
render=False,
mapfile=mapFile,
**args)
mapLayer.GetRenderMgr().updateProgress.connect(self.GetRenderMgr().ReportProgress)
if render_env:
mapLayer.GetRenderMgr().UpdateRenderEnv(render_env)
render_env = dict()
exists = False
for i, layer in enumerate(existingLayers):
if layer.GetCmd(
string=True) == mapLayer.GetCmd(
string=True):
string=True) == utils.GetCmdString(cmdlist_to_tuple(cmd)):
exists = True
if layersOrder[i] == -1:
......@@ -249,6 +236,18 @@ class DMonMap(Map):
if exists:
continue
mapLayer = classLayer(name=name,
cmd=cmd,
Map=None,
hidden=True,
render=False,
mapfile=mapFile,
**args)
mapLayer.GetRenderMgr().updateProgress.connect(self.GetRenderMgr().ReportProgress)
if render_env:
mapLayer.GetRenderMgr().UpdateRenderEnv(render_env)
render_env = dict()
newLayer = self._addLayer(mapLayer)
existingLayers.append(newLayer)
......
......@@ -98,12 +98,6 @@ int main(int argc, char *argv[])
"and some indices require additional bands.");
/* Define the different options */
opt.red = G_define_standard_option(G_OPT_R_INPUT);
opt.red->key = "red";
opt.red->label =
_("Name of input red channel surface reflectance map");
opt.red->description = _("Range: [0.0;1.0]");
opt.output = G_define_standard_option(G_OPT_R_OUTPUT);
opt.viname = G_define_option();
......@@ -137,13 +131,21 @@ int main(int argc, char *argv[])
opt.viname->answer = "ndvi";
opt.viname->key_desc = _("type");
opt.red = G_define_standard_option(G_OPT_R_INPUT);
opt.red->key = "red";
opt.red->required = NO;
opt.red->label =
_("Name of input red channel surface reflectance map");
opt.red->description = _("Range: [0.0;1.0]");
opt.red->guisection = _("Inputs");
opt.nir = G_define_standard_option(G_OPT_R_INPUT);
opt.nir->key = "nir";
opt.nir->required = NO;
opt.nir->label =
_("Name of input nir channel surface reflectance map");
opt.nir->description = _("Range: [0.0;1.0]");
opt.nir->guisection = _("Optional inputs");
opt.nir->guisection = _("Inputs");
opt.green = G_define_standard_option(G_OPT_R_INPUT);
opt.green->key = "green";
......@@ -151,7 +153,7 @@ int main(int argc, char *argv[])
opt.green->label =
_("Name of input green channel surface reflectance map");
opt.green->description = _("Range: [0.0;1.0]");
opt.green->guisection = _("Optional inputs");
opt.green->guisection = _("Inputs");
opt.blue = G_define_standard_option(G_OPT_R_INPUT);
opt.blue->key = "blue";
......@@ -159,7 +161,7 @@ int main(int argc, char *argv[])
opt.blue->label =
_("Name of input blue channel surface reflectance map");
opt.blue->description = _("Range: [0.0;1.0]");
opt.blue->guisection = _("Optional inputs");
opt.blue->guisection = _("Inputs");
/* TODO: the naming is suboptimal as specific to Landsat-7 */
opt.chan5 = G_define_standard_option(G_OPT_R_INPUT);
......@@ -168,7 +170,7 @@ int main(int argc, char *argv[])
opt.chan5->label =
_("Name of input 5th channel surface reflectance map");
opt.chan5->description = _("Range: [0.0;1.0]");
opt.chan5->guisection = _("Optional inputs");
opt.chan5->guisection = _("Inputs");
/* TODO: the naming is suboptimal as specific to Landsat-7 */
opt.chan7 = G_define_standard_option(G_OPT_R_INPUT);
......@@ -177,7 +179,7 @@ int main(int argc, char *argv[])
opt.chan7->label =
_("Name of input 7th channel surface reflectance map");
opt.chan7->description = _("Range: [0.0;1.0]");
opt.chan7->guisection = _("Optional inputs");
opt.chan7->guisection = _("Inputs");
opt.sl_slope = G_define_option();
opt.sl_slope->key = "soil_line_slope";
......
......@@ -344,7 +344,7 @@ void check_create_import_opts(struct Option *opt, char *element, FILE *fp)
int has_import = 0;
char **tokens;
tokens = G_tokenize(opt->answer, "+");
tokens = G_tokenize(opt->answer, "@");
while (tokens[i]) {
G_chop(tokens[i]);
i++;
......
......@@ -1182,6 +1182,14 @@ def load_env(grass_env_file):
os.environ['LD_LIBRARY_PATH'] = libpath + os.pathsep + isislibpath + os.pathsep + isis3rdparty
def install_notranslation():
# If locale is not supported, _ function might be missing
# This function just installs _ as a pass-through function
# See trac #3875 for details
import builtins
builtins.__dict__['_'] = lambda x: x
def set_language(grass_config_dir):
# This function is used to override system default language and locale
# Such override can be requested only from wxGUI
......@@ -1230,11 +1238,12 @@ def set_language(grass_config_dir):
# it would be too drastic to exit
# sys.exit("Fix system locale settings and then try again.")
locale.setlocale(locale.LC_ALL, 'C')
sys.stderr.write("Default locale settings are missing. GRASS running with C locale.")
sys.stderr.write("Default locale settings are missing. GRASS running with C locale.\n")
language, encoding = locale.getdefaultlocale()
if not language:
sys.stderr.write("Default locale settings are missing. GRASS running with C locale.")
sys.stderr.write("Default locale settings are missing. GRASS running with C locale.\n")
install_notranslation()
return
else:
......@@ -1267,6 +1276,7 @@ def set_language(grass_config_dir):
" en_US.UTF-8 locale and restart GRASS.\n"
"Also consider upgrading your Python version"
" to one containing fix for Python Issue 30755.\n")
install_notranslation()
return
# en_US locale might be missing, still all messages in
# GRASS are already in en_US language.
......@@ -1293,6 +1303,7 @@ def set_language(grass_config_dir):
"If you observe UnicodeError in Python,"
" install en_US.UTF-8"
" locale and restart GRASS.\n")
install_notranslation()
return
else:
# The last attempt...
......@@ -1311,6 +1322,7 @@ def set_language(grass_config_dir):
# language
os.environ['LANGUAGE'] = language
os.environ['LANG'] = language
install_notranslation()
return
# Set up environment for subprocesses
......
......@@ -6,7 +6,7 @@ usage()
Usage: geos-config [OPTIONS]
Options:
[--prefix]
[--libs]
[--clibs]
[--cflags]
[--ldflags]
[--includes]
......@@ -28,7 +28,7 @@ case $1 in
--cflags)
echo -I$OSGEO4W_ROOT_MSYS/include
;;
--libs)
--clibs)
echo $OSGEO4W_ROOT_MSYS/lib/geos_c.lib
;;
--ldflags)
......
#!/usr/bin/bash
# osgeo4w-setup -g -k -a x86_64 -q -P gdal proj geos fftw libjpeg liblas-devel libpng libpq libtiff libxdr pdcurses regex-devel sqlite3 zstd-devel zstd laszip2
# osgeo4w-setup -g -k -a x86_64 -q -P gdal proj geos fftw libjpeg liblas-devel libpng libpq libtiff libxdr pdcurses regex-devel sqlite3 zstd-devel zstd laszip2 python3-core python3-six
set -e
......@@ -166,14 +166,6 @@ else
conf_opts=
fi
mkdir -p dist.$conf_host/bin
cp -uv $DLLS dist.$conf_host/bin
mkdir -p mswindows/osgeo4w/lib
cp -uv $OSGEO4W_ROOT_MSYS/lib/libpq.lib mswindows/osgeo4w/lib/pq.lib
cp -uv $OSGEO4W_ROOT_MSYS/lib/proj_i.lib mswindows/osgeo4w/lib/proj.lib
cp -uv $OSGEO4W_ROOT_MSYS/lib/sqlite3_i.lib mswindows/osgeo4w/lib/sqlite3.lib
if ! [ -f mswindows/osgeo4w/configure-stamp ]; then
if [ -e include/Make/Platform.make ] ; then
log make distclean
......@@ -183,6 +175,14 @@ if ! [ -f mswindows/osgeo4w/configure-stamp ]; then
log remove old logs
rm -f mswindows/osgeo4w/package.log.*
mkdir -p dist.$conf_host/bin
cp -uv $DLLS dist.$conf_host/bin
mkdir -p mswindows/osgeo4w/lib
cp -uv $OSGEO4W_ROOT_MSYS/lib/libpq.lib mswindows/osgeo4w/lib/pq.lib
cp -uv $OSGEO4W_ROOT_MSYS/lib/proj_i.lib mswindows/osgeo4w/lib/proj.lib
cp -uv $OSGEO4W_ROOT_MSYS/lib/sqlite3_i.lib mswindows/osgeo4w/lib/sqlite3.lib
log configure
./configure \
--host=$conf_host \
......
......@@ -21,10 +21,21 @@ to determine the direction and magnitude of water flow velocity. To include a
predefined direction of flow, map algebra can be used to replace terrain-derived
partial derivatives with pre-defined partial derivatives in selected grid cells such
as man-made channels, ditches or culverts. Equations (2) and (3) from
<a href="http://www4.ncsu.edu/~hmitaso/gmslab/reports/cerl99/rep99.html">this report</a>
<a href="http://fatra.cnr.ncsu.edu/~hmitaso/gmslab/reports/cerl99/rep99.html">this report</a>
can be used to compute partial derivates of the predefined flow using its direction given
by aspect and slope.
<p>
<div align="center" style="margin: 10px;">
<img style="margin: 0.5em;" src="r_sim_water.png" alt="r.sim.water generated depth map"><br>
<i >
Figure: Simulated water flow in a rural area
showing the areas with highest water depth
highlighting streams, pooling, and wet areas
during a rainfall event.
</i>
</div>
<p>
The module automatically converts horizontal distances from feet to metric system using
database/projection information. Rainfall excess is defined as rainfall intensity
......@@ -137,26 +148,46 @@ for large, cutting-edge applications using high performance computing.
<h2>EXAMPLE</h2>
Spearfish region:
Using the North Carolina full sample dataset:
<div class="code"><pre>
g.region raster=elevation.10m -p
r.slope.aspect elevation=elevation.10m dx=elev_dx dy=elev_dy
# set computational region
g.region raster=elev_lid792_1m -p
# compute dx, dy
r.slope.aspect elevation=elev_lid792_1m dx=elev_lid792_dx dy=elev_lid792_dy
# synthetic maps
r.mapcalc "rain = if(elevation.10m, 5.0, null())"
r.mapcalc "manning = if(elevation.10m, 0.05, null())"
r.mapcalc "infilt = if(elevation.10m, 0.0, null())"
# simulate (this may take a minute or two)
r.sim.water elevation=elev_lid792_1m dx=elev_lid792_dx dy=elev_lid792_dy depth=water_depth disch=water_discharge nwalk=10000 rain_value=100 niter=5
</pre></div>
Now, let's visualize the result using rendering to a file
(note the further management of computational region and
usage of <a href="d.mon.html">d.mon</a> module
which are not needed when working in GUI):
# simulate
r.sim.water elevation=elevation.10m dx=elev_dx dy=elev_dy rain=rain man=manning infil=infilt nwalkers=5000000 depth=depth
<div class="code"><pre>
# increase the computational region by 350 meters
g.region e=e+350
# initiate the rendering
d.mon start=cairo output=r_sim_water_water_depth.png
# render raster, legend, etc.
d.rast map=water_depth_1m
d.legend raster=water_depth_1m title="Water depth [m]" label_step=0.10 font=sans at=20,80,70,75
d.barscale at=67,10 length=250 segment=5 font=sans
d.northarrow at=90,25
# finish the rendering
d.mon stop=cairo
</pre></div>
<p>
<center>
<img src="r_sim_water.png" alt="r.sim.water generated depth map"><br>
<i>Figure: Water depth map in the Spearfish (SD) area</i>
</center>
<div align="center" style="margin: 10px;">
<img style="margin: 0.5em;" src="r_sim_water_water_depth.png" alt="r.sim.water generated depth map"><br>
<i >
Figure: Simulated water depth map in the rural area of
the North Carolina sample dataset.
</i>
</div>
<h2>ERROR MESSAGES</h2>
......@@ -173,7 +204,7 @@ then a lower <b>nwalkers</b> parameter value has to be selected.
<ul>
<li> Mitasova, H., Thaxton, C., Hofierka, J., McLaughlin, R., Moore, A., Mitas L., 2004,
<a href="http://www4.ncsu.edu/~hmitaso/gmslab/papers/II.6.8_Mitasova_044.pdf">
<a href="http://fatra.cnr.ncsu.edu/~hmitaso/gmslab/papers/II.6.8_Mitasova_044.pdf">
Path sampling method for modeling overland water flow, sediment transport
and short term terrain evolution in Open Source GIS.</a>
In: C.T. Miller, M.W. Farthing, V.G. Gray, G.F. Pinder eds.,
......@@ -181,7 +212,7 @@ Proceedings of the XVth International Conference on Computational Methods in Wat
Resources (CMWR XV), June 13-17 2004, Chapel Hill, NC, USA, Elsevier, pp. 1479-1490.
<li> Mitasova H, Mitas, L., 2000,
<a href="http://www4.ncsu.edu/~hmitaso/gmslab/gisc00/duality.html">Modeling spatial
<a href="http://fatra.cnr.ncsu.edu/~hmitaso/gmslab/gisc00/duality.html">Modeling spatial
processes in multiscale framework: exploring duality between particles and fields,</a>
plenary talk at GIScience2000 conference, Savannah, GA.
......@@ -189,7 +220,7 @@ plenary talk at GIScience2000 conference, Savannah, GA.
for effective erosion prevention. Water Resources Research, 34(3), 505-516.
<li> Mitasova, H., Mitas, L., 2001,
<a href="http://www4.ncsu.edu/~hmitaso/gmslab/papers/LLEmiterev1.pdf">
<a href="http://fatra.cnr.ncsu.edu/~hmitaso/gmslab/papers/LLEmiterev1.pdf">
Multiscale soil erosion simulations for land use management,</a>
In: Landscape erosion and landscape evolution modeling, Harmon R. and Doe W. eds.,
Kluwer Academic/Plenum Publishers, pp. 321-347.
......@@ -203,7 +234,7 @@ GRASS users conference 2002 - Trento, Italy, 11-13 September 2002.
Simulating aspects of a flash flood using the Monte Carlo method and
GRASS GIS: a case study of the Mal&aacute; Svinka Basin (Slovakia),
Open Geosciences. Volume 7, Issue 1, ISSN (Online) 2391-5447, DOI:
<a href="http://dx.doi.org/10.1515/geo-2015-0013">10.1515/geo-2015-0013</a>,
<a href="https://doi.org/10.1515/geo-2015-0013">10.1515/geo-2015-0013</a>,
April 2015
<li> Neteler, M. and Mitasova, H., 2008,
......
......@@ -672,6 +672,8 @@ def install_extension(source, url, xmlurl):
return
ret = 0
installed_modules = []
tmp_dir = None
for module in mlist:
if sys.platform == "win32":
ret += install_extension_win(module)
......@@ -1026,7 +1028,7 @@ def install_extension_win(name):
"grass-%(major)s.%(minor)s.%(patch)s" % \
{'platform': platform,
'major': version[0], 'minor': version[1],
'patch': 'dev'}
'patch': version[2]}
# resolve ZIP URL
source, url = resolve_source_code(url='{0}/{1}.zip'.format(base_url, name))
......
......@@ -14,7 +14,7 @@ int vect_to_rast(const char *vector_map, const char *raster_map, const char *fie
{
struct Map_info Map;
struct line_pnts *Points;
int i, field;
int i, j, field;
struct cat_list *cat_list = NULL;
int fd; /* for raster map */
int nareas, nlines; /* number of converted features */
......@@ -82,6 +82,7 @@ int vect_to_rast(const char *vector_map, const char *raster_map, const char *fie
db_close_database_shutdown_driver(Driver);
j = 0;
for (i = 0; i < cvarr.n_values; i++) {
if (ctype == DB_C_TYPE_INT) {
G_debug(3, "cat = %d val = %d", cvarr.value[i].cat,
......@@ -91,6 +92,16 @@ int vect_to_rast(const char *vector_map, const char *raster_map, const char *fie
G_debug(3, "cat = %d val = %f", cvarr.value[i].cat,
cvarr.value[i].val.d);
}
/* check for null values */
if (!cat_list || Vect_cat_in_cat_list(cvarr.value[i].cat, cat_list)) {
if (cvarr.value[i].isNull) {
j++;
}
}
}
if (j) {
G_important_message(_("%d of %d records in column <%s> are empty and replaced with 0 (zero)"),
j, nrec, column);
}
switch (ctype) {
......