So, as promised an r.viewshed update. I’m basically done. Right now I’m running a few tests to get a better feel for the timing and work out any bugs, and hopefully you should be seeing it added to the svn version of GRASS within the next day or so.
Right now I have run into one issue that I’m not sure about. The header I’m storing only has space for one resolution, while GRASS’s Cell_head has space for two (ew_res and ns_res) (I do this because that was how the algorithm was orriginally written and it makes calculations MUCH easier and cleaner.) Anyway, so, I tried to make sure that ew_res and ns_res are equal before I set it, but I have since realized that they are floats, and therefore will not compare nicely.
So, do I need to do this comparison? Will ns_res always equal ew_res, or are there some situations where they are not equal? If I do need to do the comparison, how should I go about doing it?
I was finally trying r.viewshed but got some troubles:
GRASS 6.4.svn (patUTM32):~ > r.viewshed input=pat_dtm_5m
output=viewshed viewpoint_location=663435,5104325
viewpoint converted from lat-lon mode: (355,876)
Options set as:
---input: pat_dtm_5m
---output: viewshed
---viewpoint: (355, 876)
---outputting viewshed in angle mode:
---The output is {NODATA, -1(invisible),angle(visible)}.
---observer elevation above terrain: 0.000000
---max distance: infinity
---consider earth curvature: 0
---max memory = 500 MB
---------------------------------
nodata value set to nan
get_viewshed_memory usage: size AEvent=24B, nevents=3740742,
total=94774752 B (90 MB)
In-memory memory usage is 94774752 B (90 MB), max mem allowed=524288000 B(500MB)
*************
IN_MEMORY MODE
*************
Start sweeping.
total size of eventlist is 89777808 B (85 MB); size_t is 8 B
max size_t is -1
running the program in-memory mode requires memory beyond the
capability of the platform. Use external mode, or 64-bit platform.
GRASS 6.4.svn (patUTM32):~ > r.viewshed input=pat_dtm_5m
output=viewshed viewpoint_location=663435,5104325 mem=6000
viewpoint converted from lat-lon mode: (355,876)
Options set as:
---input: pat_dtm_5m
---output: viewshed
---viewpoint: (355, 876)
---outputting viewshed in angle mode:
---The output is {NODATA, -1(invisible),angle(visible)}.
---observer elevation above terrain: 0.000000
---max distance: infinity
---consider earth curvature: 0
---max memory = 6000 MB
---------------------------------
nodata value set to nan
get_viewshed_memory usage: size AEvent=24B, nevents=3740742,
total=94774752 B (90 MB)
In-memory memory usage is 94774752 B (90 MB), max mem
allowed=6291456000 B(6000MB)
*************
IN_MEMORY MODE
*************
Start sweeping.
total size of eventlist is 89777808 B (85 MB); size_t is 8 B
max size_t is -1
running the program in-memory mode requires memory beyond the
capability of the platform. Use external mode, or 64-bit platform.
GRASS 6.4.svn (patUTM32):~ > head -1 /proc/meminfo
MemTotal: 8167044 kB
GRASS 6.4.svn (patUTM32):~ > uname -a
Linux fep.cealp.local 2.6.18-92.1.6.el5 #1 SMP Wed Jun 25 12:38:37 EDT
2008 x86_64 x86_64 x86_64 GNU/Linux
So it is a 64bit box with quite some memory. Why doesn't it run?
Start sweeping.
total size of eventlist is 89777808 B (85 MB); size_t is 8 B
max size_t is -1
running the program in-memory mode requires memory beyond the
capability of the platform. Use external mode, or 64-bit platform.
Thanks to Laura, fixed in Addons-SVN.
I made a test:
- r.los: 4.5 hours
- r.viewshed: 18 seconds.