[GRASS-user] Openness Calculation
Anna Petrášová
kratochanna at gmail.com
Tue Nov 12 20:12:02 PST 2013
Hi,
On Mon, Nov 4, 2013 at 2:16 PM, Anna Petrášová <kratochanna at gmail.com>wrote:
> Hi,
>
>
> On Mon, Nov 4, 2013 at 1:36 PM, Rebecca Bennett <rabennett at ymail.com>wrote:
>
>> Dear GRASS users,
>>
>> I have recently been made aware of the positive and negative openness
>> vizualisations (Yokoyama et al 2002
>> http://www.asprs.org/a/publications/pers/2002journal/march/2002_mar_257-265.pdf)
>> and would like to try to compute them in GRASS to help identify micro
>> relief.
>>
>> Though I suspect that this has already been done, I can't find a heads up
>> other than this paper (which claims to have creates the web service based
>> on GRASS here
>> http://geobrain.laits.gmu.edu/grassweb/manuals/raster/openness.html)
>>
>> http://www.lpi.usra.edu/science/stepinskiWebPage/pdfFiles/geoinformaticsConf2009.pdf
>>
>> Just a note that although similar in it's aim of highlighting
>> microtopography, this is not quite the same as the r.horizon calculation
>> (image attached for clarification).
>>
>> All the best,
>> Rebecca
>>
>>
>>
>
> I added recently a module r.skyview to grass 7 addons for computing the
> sky-view factor [1]. It uses r.horizon module. I am not sure how much
> different is what r.horizon can do and what you need but it's worth looking
> if r.horizon cannot be extended easily and then used for the openness
> computation.
>
> Anna
>
>
>
I attached a simple patch for r.horizon which enables to output also
negative elevation angles. Addon r.skyview can be then extended to compute
also openness besides the skyview factor (the difference is just the range
of elevation angles if I understood correctly). It looks like the negative
openness can be then computed in the same way, but with inverted elevation.
Regards,
Anna
> [1] https://svn.osgeo.org/grass/grass-addons/grass7/raster/r.skyview/
>
>>
>>
>>
>> _______________________________________________
>> grass-user mailing list
>> grass-user at lists.osgeo.org
>> http://lists.osgeo.org/mailman/listinfo/grass-user
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/grass-user/attachments/20131112/4fb5c73b/attachment.html>
-------------- next part --------------
Index: main.c
===================================================================
--- main.c (revision 58190)
+++ main.c (working copy)
@@ -108,6 +108,7 @@
int ip, jp, ip100, jp100;
int n, m, m100, n100;
int degreeOutput = FALSE;
+int negative_angles = FALSE;
float **z, **z100, **horizon_raster;
double stepx, stepy, stepxhalf, stepyhalf, stepxy, xp, yp, op, dp, xg0, xx0,
yg0, yy0, deltx, delty;
@@ -168,7 +169,7 @@
struct
{
- struct Flag *degreeOutput;
+ struct Flag *degreeOutput, *negative_angles;
}
flag;
@@ -295,6 +296,10 @@
flag.degreeOutput->description =
_("Write output in degrees (default is radians)");
+ flag.negative_angles = G_define_flag();
+ flag.negative_angles->key = 'n';
+ flag.negative_angles->description =
+ _("Allow negative elevation angles");
if (G_parser(argc, argv))
exit(EXIT_FAILURE);
@@ -330,6 +335,7 @@
delty = fabs(cellhd.north - cellhd.south);
degreeOutput = flag.degreeOutput->answer;
+ negative_angles = flag.negative_angles->answer;
elevin = parm.elevin->answer;
@@ -712,7 +718,10 @@
{
double height;
- tanh0 = 0.;
+ if (negative_angles)
+ tanh0 = -BIG;
+ else
+ tanh0 = 0.;
length = 0;
height = searching();
More information about the grass-user
mailing list