GDAL
February 15, 2016, 3:49pm
1
#2919: r.stream.extract error
------------------------------+-------------------------
Reporter: PitStop | Owner: grass-dev@…
Type: defect | Status: new
Priority: normal | Milestone:
Component: Addons | Version: 7.0.3
Keywords: r.stream.extract | CPU: x86-64
Platform: MSWindows 7 |
------------------------------+-------------------------
Hi There,
I'm trying to delineate a watershed and also extract the streams within
using here for reproduction the NC data set.
{{{
r.watershed elevation=elev_srtm_30m@PERMANENT threshold=1000
accumulation=accu drainage=drain basin=basin
}}}
and then
{{{
r.stream.extract elevation=elev_srtm_30m@PERMANENT accumulation=accu@user1
threshold=1000 stream_raster=stream_r stream_vector=stream_v
}}}
leads to
{{{
ERROR: Missing value for parameter <d8cut>
}}}
while the accumulation map is specified in the command and therefor d8cut
shouldn't be used.
The same error was report [http://osgeo-org.1560.x6.nabble.com/r-stream-
extract-grass7-addon-td5018389.html#a5018528]
g.version -g
{{{
version=7.0.3
date=2016
revision=67691
build_date=2016-01-28
build_platform=x86_64-w64-mingw32
}}}
--
Ticket URL: <https://trac.osgeo.org/grass/ticket/2919> ;
GRASS GIS <https://grass.osgeo.org >
GDAL
February 20, 2016, 1:41pm
2
#2919: r.stream.extract error
----------------------+------------------------------
Reporter: PitStop | Owner: grass-dev@…
Type: defect | Status: new
Priority: normal | Milestone: 7.0.4
Component: Addons | Version: 7.0.3
Resolution: | Keywords: r.stream.extract
CPU: x86-64 | Platform: MSWindows 7
----------------------+------------------------------
Changes (by neteler):
* milestone: => 7.0.4
Comment:
I just tried on Linux, no such issue:
{{{
g.region raster=elev_srtm_30m
r.watershed elevation=elev_srtm_30m@PERMANENT threshold=1000
accumulation=accu drainage=drain basin=basin
r.stream.extract elevation=elev_srtm_30m@PERMANENT accumulation=accu@user1
\
threshold=1000 stream_raster=stream_r stream_vector=stream_v
}}}
No errors occured.
{{{
g.version -g
version=7.0.4svn
date=2016
revision=67880M
build_date=2016-01-20
build_platform=x86_64-pc-linux-gnu
}}}
You marked it as "addon" while it is part of core GRASS 7. Is it possible
that you are using a leftover Addon version of r.stream.extract?
--
Ticket URL: <https://trac.osgeo.org/grass/ticket/2919#comment:1> ;
GRASS GIS <https://grass.osgeo.org >
GDAL
February 20, 2016, 2:14pm
3
#2919: r.stream.extract error
----------------------+------------------------------
Reporter: PitStop | Owner: grass-dev@…
Type: defect | Status: new
Priority: normal | Milestone: 7.0.4
Component: Addons | Version: 7.0.3
Resolution: | Keywords: r.stream.extract
CPU: x86-64 | Platform: MSWindows 7
----------------------+------------------------------
Comment (by hellik):
Replying to [comment:1 neteler]:
> I just tried on Linux, no such issue:
>
> {{{
> g.region raster=elev_srtm_30m
> r.watershed elevation=elev_srtm_30m@PERMANENT threshold=1000
> accumulation=accu drainage=drain basin=basin
> r.stream.extract elevation=elev_srtm_30m@PERMANENT
accumulation=accu@user1 \
> threshold=1000 stream_raster=stream_r stream_vector=stream_v
> }}}
>
> No errors occured.
>
> {{{
> g.version -g
> version=7.0.4svn
> date=2016
> revision=67880M
> build_date=2016-01-20
> build_platform=x86_64-pc-linux-gnu
> }}}
>
> You marked it as "addon" while it is part of core GRASS 7. Is it
possible that you are using a leftover Addon version of r.stream.extract?
Confirmed here in winGRASS. the default value of d8cut seems not to be
recognized by parser in winGRASS again. see the mentioned ML entry.
--
Ticket URL: <http://trac.osgeo.org/grass/ticket/2919#comment:2> ;
GRASS GIS <https://grass.osgeo.org >
GDAL
February 20, 2016, 2:32pm
4
#2919: r.stream.extract error
----------------------+------------------------------
Reporter: PitStop | Owner: grass-dev@…
Type: defect | Status: new
Priority: normal | Milestone: 7.0.4
Component: Addons | Version: 7.0.3
Resolution: | Keywords: r.stream.extract
CPU: x86-64 | Platform: MSWindows 7
----------------------+------------------------------
Comment (by neteler):
I see: the change r53993 (remove default: infinity) was not applied to
relbranch7, see
https://trac.osgeo.org/grass/browser/grass/branches/releasebranch_7_0/raster/r.stream.extract/main.c#L113
Seems that "infinity" is not understood by the parser?
https://trac.osgeo.org/grass/browser/grass/branches/releasebranch_7_0/raster/r.stream.extract/main.c#L195
--
Ticket URL: <https://trac.osgeo.org/grass/ticket/2919#comment:3> ;
GRASS GIS <https://grass.osgeo.org >
GDAL
October 4, 2016, 2:48pm
5
#2919: r.stream.extract error
----------------------+------------------------------
Reporter: PitStop | Owner: grass-dev@…
Type: defect | Status: new
Priority: normal | Milestone: 7.0.6
Component: Addons | Version: 7.0.3
Resolution: | Keywords: r.stream.extract
CPU: x86-64 | Platform: MSWindows 7
----------------------+------------------------------
Comment (by hellik):
Replying to [comment:3 neteler]:
> I see: the change r53993 (remove default: infinity) was not applied to
relbranch7, see
>
>
https://trac.osgeo.org/grass/browser/grass/branches/releasebranch_7_0/raster/r.stream.extract/main.c#L113
>
> Seems that "infinity" is not understood by the parser?
>
>
https://trac.osgeo.org/grass/browser/grass/branches/releasebranch_7_0/raster/r.stream.extract/main.c#L195
still an issue in all g7-variants.
--
Ticket URL: <https://trac.osgeo.org/grass/ticket/2919#comment:6> ;
GRASS GIS <https://grass.osgeo.org >
GDAL
October 28, 2017, 4:42pm
6
#2919: Use SFD above this threshold - infinity doesn't work in r.stream.extract
----------------------+---------------------------------
Reporter: PitStop | Owner: grass-dev@…
Type: defect | Status: new
Priority: normal | Milestone: 7.2.3
Component: Addons | Version: svn-releasebranch72
Resolution: | Keywords: r.stream.extract
CPU: x86-64 | Platform: MSWindows 7
----------------------+---------------------------------
Changes (by hellik):
* milestone: 7.0.6 => 7.2.3
* version: 7.0.3 => svn-releasebranch72
Comment:
changing title.
see also #3432
--
Ticket URL: <https://trac.osgeo.org/grass/ticket/2919#comment:7> ;
GRASS GIS <https://grass.osgeo.org >
GDAL
October 28, 2017, 4:44pm
7
#2919: Use SFD above this threshold - infinity doesn't work in r.stream.extract
----------------------+---------------------------------
Reporter: PitStop | Owner: grass-dev@…
Type: defect | Status: new
Priority: normal | Milestone: 7.2.3
Component: Addons | Version: svn-releasebranch72
Resolution: | Keywords: r.stream.extract
CPU: x86-64 | Platform: MSWindows 7
----------------------+---------------------------------
Comment (by hellik):
taken from #3432
still an issue in relbranch 7
{{{
System Info
GRASS version: 7.3.svn
GRASS SVN revision: r71600
Build date: 2017-10-27
Build platform: x86_64-w64-mingw32
GDAL: 2.2.1
PROJ.4: 4.9.3
GEOS: 3.5.0
SQLite: 3.17.0
Python: 2.7.5
wxPython: 2.8.12.1
Platform: Windows-8-6.2.9200 (OSGeo4W)
}}}
and trunk
{{{
System Info
GRASS version: 7.2.2
GRASS SVN revision: r71496
Build date: 2017-09-20
Build platform: x86_64-w64-mingw32
GDAL: 2.2.1
PROJ.4: 4.9.3
GEOS: 3.5.0
SQLite: 3.17.0
Python: 2.7.5
wxPython: 2.8.12.1
Platform: Windows-8-6.2.9200 (OSGeo4W)
}}}
--
Ticket URL: <https://trac.osgeo.org/grass/ticket/2919#comment:8> ;
GRASS GIS <https://grass.osgeo.org >
GDAL
October 28, 2017, 4:45pm
8
#2919: Use SFD above this threshold - infinity doesn't work in r.stream.extract
----------------------+---------------------------------
Reporter: PitStop | Owner: grass-dev@…
Type: defect | Status: new
Priority: normal | Milestone: 7.2.3
Component: Raster | Version: svn-releasebranch72
Resolution: | Keywords: r.stream.extract
CPU: x86-64 | Platform: MSWindows 8
----------------------+---------------------------------
Changes (by hellik):
* platform: MSWindows 7 => MSWindows 8
* component: Addons => Raster
--
Ticket URL: <https://trac.osgeo.org/grass/ticket/2919#comment:9> ;
GRASS GIS <https://grass.osgeo.org >
GDAL
October 28, 2017, 4:52pm
9
#2919: Use SFD above this threshold - infinity doesn't work in r.stream.extract
----------------------+---------------------------------
Reporter: PitStop | Owner: grass-dev@…
Type: defect | Status: new
Priority: normal | Milestone: 7.2.3
Component: Raster | Version: svn-releasebranch72
Resolution: | Keywords: r.stream.extract
CPU: x86-64 | Platform: MSWindows 8
----------------------+---------------------------------
Comment (by hellik):
Replying to [comment:3 neteler]:
> I see: the change r53993 (remove default: infinity) was not applied to
relbranch7, see
>
>
https://trac.osgeo.org/grass/browser/grass/branches/releasebranch_7_0/raster/r.stream.extract/main.c#L113
>
> Seems that "infinity" is not understood by the parser?
>
>
https://trac.osgeo.org/grass/browser/grass/branches/releasebranch_7_0/raster/r.stream.extract/main.c#L195
yes, it seems to be a parser issue. but why it works then in linux?
--
Ticket URL: <https://trac.osgeo.org/grass/ticket/2919#comment:10> ;
GRASS GIS <https://grass.osgeo.org >
GDAL
October 29, 2017, 11:00am
10
#2919: Use SFD above this threshold - infinity doesn't work in r.stream.extract
----------------------+---------------------------------
Reporter: PitStop | Owner: grass-dev@…
Type: defect | Status: new
Priority: normal | Milestone: 7.2.3
Component: Raster | Version: svn-releasebranch72
Resolution: | Keywords: r.stream.extract
CPU: x86-64 | Platform: MSWindows 8
----------------------+---------------------------------
Comment (by marisn):
Replying to [comment:10 hellik]:
> > Seems that "infinity" is not understood by the parser?
> >
> >
https://trac.osgeo.org/grass/browser/grass/branches/releasebranch_7_0/raster/r.stream.extract/main.c#L195
>
> yes, it seems to be a parser issue. but why it works then in linux?
My guess - input.d8cut->answer contains extra chars (CR/LF issue?) and
thus changing line to read:
{{{
if (strncmp(input.d8cut->answer, "infinity", 8) == 0) {
}}}
would solve the issue. Still, if it is so, then it is worth to digg deeper
to see why it is failing as strcmp is used in many modules.
--
Ticket URL: <https://trac.osgeo.org/grass/ticket/2919#comment:11> ;
GRASS GIS <https://grass.osgeo.org >
GDAL
October 29, 2017, 3:53pm
11
#2919: Use SFD above this threshold - infinity doesn't work in r.stream.extract
----------------------+---------------------------------
Reporter: PitStop | Owner: grass-dev@…
Type: defect | Status: new
Priority: normal | Milestone: 7.2.3
Component: Raster | Version: svn-releasebranch72
Resolution: | Keywords: r.stream.extract
CPU: x86-64 | Platform: MSWindows 8
----------------------+---------------------------------
Comment (by mmetz):
Replying to [comment:11 marisn]:
> Replying to [comment:10 hellik]:
> > > Seems that "infinity" is not understood by the parser?
> > >
> > >
https://trac.osgeo.org/grass/browser/grass/branches/releasebranch_7_0/raster/r.stream.extract/main.c#L195
> >
> > yes, it seems to be a parser issue. but why it works then in linux?
> My guess - input.d8cut->answer contains extra chars (CR/LF issue?)
there can't be CR/LF, answers are terminated by '\0'
> and thus changing line to read:
> {{{
> if (strncmp(input.d8cut->answer, "infinity", 8) == 0) {
> }}}
> would solve the issue.
The d8cut option is not required, therefore I removed the problematic
default answer "infinity" and changed
{{{
- if (strcmp(input.d8cut->answer, "infinity") == 0) {
+ if (!input.d8cut->answer) {
}}}
in trunk and relbr72 with r71607,8.
> Still, if it is so, then it is worth to digg deeper to see why it is
failing as strcmp is used in many modules.
I guess that the MS Windows version of sscanf does not recognize infinity
as a floating point number, while the Linux version does.
--
Ticket URL: <https://trac.osgeo.org/grass/ticket/2919#comment:12> ;
GRASS GIS <https://grass.osgeo.org >
GDAL
June 26, 2020, 10:42am
12
#2919: Use SFD above this threshold - infinity doesn't work in r.stream.extract
----------------------+---------------------------------
Reporter: PitStop | Owner: grass-dev@…
Type: defect | Status: new
Priority: normal | Milestone: 7.8.3
Component: Raster | Version: git-releasebranch78
Resolution: | Keywords: r.stream.extract
CPU: x86-64 | Platform: MSWindows 8
----------------------+---------------------------------
Changes (by neteler):
* version: svn-releasebranch72 => git-releasebranch78
* milestone: 7.2.4 => 7.8.3
Comment:
The code is now here:
https://github.com/OSGeo/grass/blob/75ac17f0a3f19cbff749badaf0a46aa7d0f91537/raster/r.stream.extract/main.c#L107
Not sure what to look for?
--
Ticket URL: <https://trac.osgeo.org/grass/ticket/2919#comment:15> ;
GRASS GIS <https://grass.osgeo.org >
GDAL
June 26, 2020, 11:39am
13
#2919: Use SFD above this threshold - infinity doesn't work in r.stream.extract
----------------------+---------------------------------
Reporter: PitStop | Owner: grass-dev@…
Type: defect | Status: new
Priority: normal | Milestone: 7.8.3
Component: Raster | Version: git-releasebranch78
Resolution: | Keywords: r.stream.extract
CPU: x86-64 | Platform: MSWindows 8
----------------------+---------------------------------
Comment (by hellik):
isn't it some kind of a parser issue?
as it pops up also in other modules/addons, e.g.
https://lists.osgeo.org/pipermail/grass-user/2020-June/081577.html
worth to open a GH issue?
--
Ticket URL: <https://trac.osgeo.org/grass/ticket/2919#comment:16> ;
GRASS GIS <https://grass.osgeo.org >
GDAL
June 26, 2020, 12:15pm
14
#2919: Use SFD above this threshold - infinity doesn't work in r.stream.extract
----------------------+---------------------------------
Reporter: PitStop | Owner: grass-dev@…
Type: defect | Status: new
Priority: normal | Milestone: 7.8.3
Component: Raster | Version: git-releasebranch78
Resolution: | Keywords: r.stream.extract
CPU: x86-64 | Platform: MSWindows 8
----------------------+---------------------------------
Comment (by hellik):
some background information:
https://sourceforge.net/p/mingw/bugs/2358/
{{{
[...]
You are using Microsoft's implementation of scanf(), (because that is all
that MinGW has ever used for this function, and its siblings), so the
behaviour is as Microsoft have specified it, (and there appears to be
nothing in their documentation to suggest how infinities and nans might be
converted,
[...]
You may consider Microsoft's implementation to be broken -- and you may
well be right -- but good luck with trying to get them to acknowledge
that, much less fix it.
}}}
AFAIR there was also some discussion some times ago how winGRASS (not)
handling NaN in raster data. (can't find ticket or thread at the moment).
--
Ticket URL: <https://trac.osgeo.org/grass/ticket/2919#comment:17> ;
GRASS GIS <https://grass.osgeo.org >