[GRASS-dev] [GRASS GIS] #2341: GRASS 7.0.0. r.viewshed issue

#2341: GRASS 7.0.0. r.viewshed issue
-------------------------+--------------------------------------------------
Reporter: AJWatson | Owner: grass-dev@…
     Type: enhancement | Status: new
Priority: normal | Milestone: 7.0.0
Component: Default | Version: unspecified
Keywords: viewshed | Platform: MSWindows 8
      Cpu: Unspecified |
-------------------------+--------------------------------------------------
Attempting to run r.viewshed command on 90bn cells. Grass failed to carry
it out. I changed the g.region res=25 and it has worked now. It may be
worth looking into.

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/2341&gt;
GRASS GIS <http://grass.osgeo.org>

#2341: GRASS 7.0.0. r.viewshed issue
-------------------------+--------------------------------------------------
Reporter: AJWatson | Owner: grass-dev@…
     Type: enhancement | Status: new
Priority: normal | Milestone: 7.0.0
Component: Default | Version: unspecified
Keywords: r.viewshed | Platform: MSWindows 8
      Cpu: Unspecified |
-------------------------+--------------------------------------------------
Changes (by neteler):

  * keywords: viewshed => r.viewshed

Comment:

Replying to [ticket:2341 AJWatson]:
> Attempting to run r.viewshed command on 90bn cells. Grass failed to
carry it out.

Please post the error message.

> I changed the g.region res=25 and it has worked now. It may be worth
looking into.

Are you sure that the needed space was available in the temp directory?
The
error you got is essential for us to understand.

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/2341#comment:1&gt;
GRASS GIS <http://grass.osgeo.org>

#2341: GRASS 7.0.0. r.viewshed issue
-------------------------+--------------------------------------------------
Reporter: AJWatson | Owner: grass-dev@…
     Type: enhancement | Status: new
Priority: normal | Milestone: 7.0.0
Component: Default | Version: unspecified
Keywords: r.viewshed | Platform: MSWindows 8
      Cpu: Unspecified |
-------------------------+--------------------------------------------------

Comment(by AJWatson):

Hi,

Error message was as follows:

(Tue Jun 17 21:37:45 2014)
r.viewshed --overwrite input=MasterRaster@CotswoldSevern
output=MasterRaster coordinates=210320.28754,221864.696486
ERROR: Grid dimension too big for current precision
(Tue Jun 17 21:37:46 2014) Command finished (0 sec)

Regarding space, in the temp directory, I played around with this somewhat
from the 500mb up to 6gb.

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/2341#comment:2&gt;
GRASS GIS <http://grass.osgeo.org>

#2341: GRASS 7.0.0. r.viewshed issue
-------------------------+--------------------------------------------------
Reporter: AJWatson | Owner: grass-dev@…
     Type: enhancement | Status: new
Priority: normal | Milestone: 7.0.0
Component: Default | Version: unspecified
Keywords: r.viewshed | Platform: MSWindows 8
      Cpu: Unspecified |
-------------------------+--------------------------------------------------

Comment(by neteler):

Replying to [comment:2 AJWatson]:
...
> r.viewshed --overwrite input=MasterRaster@CotswoldSevern
output=MasterRaster coordinates=210320.28754,221864.696486
> ERROR: Grid dimension too big for current precision

Ok, now I found the issue (BTW: in SVN I have improved the error message):

{{{
cd raster/r.viewshed/

grep maxDimension *.h
grid.h:static const dimensionType maxDimension = USHRT_MAX - 1;

grep USHRT_MAX /usr/include/limits.h
# define USHRT_MAX 65535
}}}

At least on my Linux system 65535 rows/cols seem to be the hardcoded
maximum.

I see this comment in grid.h:

{{{
/* this should accomodate grid sizes up to 2^16-1=65,535
    If this is not enough, change type and recompile */
}}}

So, it might be possible to allow for more (not sure if increasing
maxDimension is sufficient and portable).

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/2341#comment:3&gt;
GRASS GIS <http://grass.osgeo.org>

#2341: GRASS 7.0.0. r.viewshed issue
-------------------------+--------------------------------------------------
Reporter: AJWatson | Owner: grass-dev@…
     Type: enhancement | Status: new
Priority: normal | Milestone: 7.0.0
Component: Default | Version: unspecified
Keywords: r.viewshed | Platform: MSWindows 8
      Cpu: Unspecified |
-------------------------+--------------------------------------------------

Comment(by AJWatson):

Sorry, I'm new to GIS and GRASS. Is there anything further you need me to
do or is there a fix?

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/2341#comment:4&gt;
GRASS GIS <http://grass.osgeo.org>

#2341: GRASS 7.0.0. r.viewshed issue
-------------------------+--------------------------------------------------
Reporter: AJWatson | Owner: grass-dev@…
     Type: enhancement | Status: new
Priority: normal | Milestone: 7.0.0
Component: Default | Version: unspecified
Keywords: r.viewshed | Platform: MSWindows 8
      Cpu: Unspecified |
-------------------------+--------------------------------------------------

Comment(by neteler):

A knowledgeable person needs to judge if maxDimension (USHRT_MAX) can be
just increased or not.
It requires a change in the source code; once done the WinGRASS nightly
snapshot will contain it.

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/2341#comment:5&gt;
GRASS GIS <http://grass.osgeo.org>

#2341: GRASS 7.0.0. r.viewshed issue
-------------------------+--------------------------------------------------
Reporter: AJWatson | Owner: grass-dev@…
     Type: enhancement | Status: new
Priority: normal | Milestone: 7.0.0
Component: Default | Version: svn-releasebranch70
Keywords: r.viewshed | Platform: MSWindows 8
      Cpu: Unspecified |
-------------------------+--------------------------------------------------
Changes (by neteler):

  * version: unspecified => svn-releasebranch70

Comment:

@devs: can the USHRT_MAX = 65535 be changed to make r.viewshed work with
larger maps? UINT_MAX as a candidate?

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/2341#comment:6&gt;
GRASS GIS <http://grass.osgeo.org>