[GRASS5] [bug #2061] (grass) r.los needs FP update

Paul Kelly paul-grass at stjohnspoint.co.uk
Thu Aug 14 09:11:11 EDT 2003


On Thu, 14 Aug 2003, Greg Sepesi wrote:

> > The algorithm in PE&RS is from the US Army CERL so it would be especially
> > appropriate for it to go into the latest GRASS. I would hope some of the
> > Vectlib and dglib functions could be used for determining the crossing
> > points and distances between the cells but I will have to learn about
> > them first.
> >
> > Paul
>
> Hi Paul,
>
> What is the definition of "crossing points" in the algorithm?

Hello Greg
My general idea is that vector network functions could be very useful for
performing some types of raster processing, if we define the centre of
every raster cell as a vector node. Each node / cell could then be linked
to its nearest neighbours by various line segments, either 4-way or 8-way
connectivity depending on the application. If a raster MASK was in force,
no nodes or lines would be created in the area covered by the MASK. Vector
networking functions could then be used to find the approximate shortest
distance between two cells (along the line segments), taking account of
the MASK, i.e. moving around the outside of it. I've no idea how accurate
this would be, e.g. it might be necessary to do 16-way connectivity
between the cells or something so the distances weren't too long.

The application I had in mind for this was interpolation around an
impenetrable barrier, see
http://grass.itc.it/pipermail/grassuser/2003-March/008637.html

But regarding the application to the line-of-sight algorithm and the
crossing points, the idea is that there is 4-way connectivity between all
the cells. When calculating the visibility of a particular target, a line
is created between the target cell node and the observer cell node. The
line-of-sight function for the centre of every cell will have already been
calculated and stored in a temporary map. This line between the target
and observer will not cross over cell centres exactly and the LOS function
needs to be calculated at regular intervals along the line, i.e.
where it crosses one of the horizontal or vertical line segments that
connect all the nodes. Interpolation will have to be done to find the LOS
function value at these crossing points.

So hopefully the vector network functions could tell me exactly where all
the crossing points were, and the distance to the nearest cell on either
side, in order to do linear interpolation.

Probably even there are some GRASS modules that already do something like
this internally, but I just thought it would be a nice application of the
directed graph library to apply it to raster processing; another library
could even be created that would have functions to create the network
based on the current region and MASK settings, and to find the distances
and crossing points and that sort of thing.

Just a few ideas for the future

Paul




More information about the grass-dev mailing list