#1864: r.horizon generates incorrect results in single point mode
-----------------------+----------------------------------------------------
Reporter: rmyorston | Owner: grass-dev@…
Type: defect | Status: new
Priority: normal | Milestone: 6.4.3
Component: Raster | Version: 6.4.2
Keywords: | Platform: Linux
Cpu: x86-32 |
-----------------------+----------------------------------------------------
I wished to use r.horizon to calculate horizon values in single point
mode. Initially I used a 50m DEM and the results looked reasonable. Later
I obtained a 10m DEM for the region and performed the same calculation.
The results were very different. When I used map mode with the 10m DEM the
result for the chosen location and angle agreed with that of the 50m DEM.
The problem seems to be in test_low_res, which is intended to switch to a
low resolution grid at a certain point in the calculation. I've built
r.horizon without the call to test_low_res (just setting succes2 to 1) and
the results with the 10m DEM agree pretty well with those for the 50m one.
In the code with the comment /*skip to the next lowres cell */ delta
values for x and y are calculated. These depend on cosangle and sinangle.
It appears that these aren't being set in single point mode, so both are
zero. This results in mindel being 32000 and hence the point calculated is
off the grid. In my case this stopped the horizon calculation after 2200m,
far too early.
I think there are other problems with test_low_res, but I didn't
investigate further.
--
Ticket URL: <http://trac.osgeo.org/grass/ticket/1864>
GRASS GIS <http://grass.osgeo.org>