[GRASS-dev] r.los scales badly

Markus Neteler neteler at fbk.eu
Tue Nov 20 08:26:28 EST 2007


On Tue, Nov 20, 2007 at 12:46:19PM +0100, Peter Hopfgartner wrote:
> Hi,
> 
> I've done some time measurements with r.los.
> 
> Basically I'm working on a DTM raster of Austria derived from SRTM data.
> 
> Thus, the region has a native res of 90m and has 2224 rows and 2228 columns.
> 
> If I'm doing a r.los after g.region -pa res=360 it takes 1.719 s to
> complete the calculation (time taken through the time command). With
> res=180, res=120, res=90 I get the following table:
> 
> res  t (s)
> ---   --------
> 360     1.72
> 180     17.96
> 120    123.68
>  90    688.37
> 
> It scales very badly. Is this expected? Are there better algorithms for
> calculating LOS then that used in r.los?

I have run valgrind on r.los (NC data set):

GRASS 6.3.cvs (nc_spm_06):~ > g.region -p | grep 'row\|col'
rows:       450
cols:       500
# rather small region!

#valgrind:
CMD="r.los elev_ned_30m out=test coord=642212,224767 obs=165 max=50000 --o"
valgrind --tool=callgrind --trace-children=yes --dump-instr=yes --trace-jump=yes $CMD
kcachegrind callgrind.out.28977

This shows up to 227361 calls to 'find_orientation' (r.los: pts_elim.c).
Not sure but problably there is space for optimization?

Markus


More information about the grass-dev mailing list