Opened 10 years ago

Closed 6 years ago

#2341 closed enhancement (fixed)

GRASS 7.0.0. r.viewshed issue

Reported by: AJWatson Owned by: grass-dev@…
Priority: normal Milestone: 7.4.0
Component: Default Version: svn-releasebranch70
Keywords: r.viewshed Cc:
CPU: Unspecified Platform: MSWindows 8

Description

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.

Change History (12)

in reply to:  description comment:1 by neteler, 10 years ago

Keywords: r.viewshed added; viewshed removed

Replying to 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.

comment:2 by AJWatson, 10 years ago

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.

in reply to:  2 comment:3 by neteler, 10 years ago

Replying to 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).

comment:4 by AJWatson, 10 years ago

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

comment:5 by neteler, 10 years ago

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.

comment:6 by neteler, 9 years ago

Version: unspecifiedsvn-releasebranch70

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

comment:7 by martinl, 8 years ago

Milestone: 7.0.07.0.5

comment:8 by martinl, 8 years ago

Milestone: 7.0.57.3.0

comment:9 by martinl, 8 years ago

Milestone: 7.3.07.4.0

Milestone renamed

comment:10 by neteler, 6 years ago

Milestone: 7.4.07.4.1

Ticket retargeted after milestone closed

comment:11 by martinl, 6 years ago

What is status of this issue?

comment:12 by neteler, 6 years ago

Milestone: 7.4.17.4.0
Resolution: fixed
Status: newclosed

r.viewshed received memory managment fixes in r71273, r71281, r71681 which are part of the new version GRASS GIS 7.4.0.

Closing as fixed, feel free to reopen if needed.

Note: See TracTickets for help on using tickets.