Visibility between polygons

Hi all. I have a visibility analysis problem which involves two polygons, ie,
the extent of a development corridor which may be seen from any point within a
town boundary. Looking at <r.los>, it presumably could be made to do this with
some tweaking. I'd appreciate any comments about what I'm proposing to do; even
better if someone can save me the task.

<R.los> can shade all areas of the corridor which are visible from a given
point in the town only. Therefore, the routine needs to be run repeatedly for
each point in the town, saving the results each time and finally overlaying
these through something like <r.combine>. Man pages for <r.combine> suggest
there is no limit to the number of input maps, but it would be prudent to
anticipate troubles in my case, maybe by performing the overlay at set
intervals. It would also be sensible to apply a dynamically updated mask to
each visibility analysis, so that only currently unseen cells are considered.

My main uncertainty concerns how much I can get away with using scripts, and
how much C programming I need to do. For example, I would like a routine which
will go through every cell in a given polygon and return a co-ordinate list,
which can then be passed to <r.los> item by item. To get that list, is
somewhere like <r.neighbours> the best place to look for code which could be
adapted, or am I missing an easier way of doing it? Last wishful extension:
it would be nice to be able to nominate co-ords interactively with the mouse,
and have visible cells highlighted (presumably by overlay) on the map. Does
this involve a simple grafting of <d.where> onto <r.los>, or am I being naively
optimistic?

The man pages for <r.los> also refer to <r.pat.place>. We have neither code nor
man pages for that routine. Has it been deleted?

--
Conn V Copas
Loughborough University of Technology tel : +44 509 263171 ext 4164
Computer-Human Interaction Research Centre fax : +44 509 610815
Leicestershire LE11 3TU e-mail - (Janet):C.V.Copas@uk.ac.lut
G Britain (Internet):C.V.Copas@lut.ac.uk

My main uncertainty concerns how much I can get away with using scripts, and
how much C programming I need to do. For example, I would like a routine which
will go through every cell in a given polygon and return a co-ordinate list,
which can then be passed to <r.los> item by item. To get that list, is
somewhere like <r.neighbours> the best place to look for code which could be
adapted, or am I missing an easier way of doing it? Last wishful extension:
it would be nice to be able to nominate co-ords interactively with the mouse,
and have visible cells highlighted (presumably by overlay) on the map. Does
this involve a simple grafting of <d.where> onto <r.los>, or am I being naively
optimistic?

I think you surely could solve this with a nice little script. You
could could select the raster area with r.mapcalc. Make a inside out
operation with r.reclass. Use r.buffer to get all pixels on the border
of of the area. Select those pixels on the border with r.mapcalc.
Then the coordinates for those pixels could be output via r.stats -g .
With a nice bourne shell for loop and and some use of awk I am sure
you could feed these coordinates into r.los for every x and y value
and output a map for time in the loop. Save these mapnames in a
file(eg. mapnames).

Make a new "for $i in `cat mapnames | awk '{print $1}'`" -loop and
patch these maps together with r.patch. r.patch can only handle
10 maps each time so you have to split list to groups of 9 maps and
save temporary maps.

I hope that I haven't been to cryptic. But with a few experiments I
think you get going. I also think d.where will work fine for an
interactive version for you.

Good luck

Lars

Lars Schylberg Email: larss@fmi.kth.se
Dept. of Geodesy and Photogrammetry
Royal Institute of Technology (KTH) Tel. +46 8 790 86 33
S-100 44 STOCKHOLM, SWEDEN Fax. +46 8 790 66 10