Opened 10 years ago
Closed 7 years ago
#2341 closed enhancement (fixed)
GRASS 7.0.0. r.viewshed issue
Reported by: | AJWatson | Owned by: | |
---|---|---|---|
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)
comment:1 by , 10 years ago
Keywords: | r.viewshed added; viewshed removed |
---|
follow-up: 3 comment:2 by , 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.
comment:3 by , 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 , 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 , 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 , 10 years ago
Version: | unspecified → svn-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 , 9 years ago
Milestone: | 7.0.0 → 7.0.5 |
---|
comment:8 by , 8 years ago
Milestone: | 7.0.5 → 7.3.0 |
---|
comment:12 by , 7 years ago
Milestone: | 7.4.1 → 7.4.0 |
---|---|
Resolution: | → fixed |
Status: | new → closed |
Replying to AJWatson:
Please post the error message.
Are you sure that the needed space was available in the temp directory? The error you got is essential for us to understand.