Hi,

On Mon, Nov 4, 2013 at 2:16 PM, Anna Petrášová <[email protected]>wrote:

> Hi,
>
>
> On Mon, Nov 4, 2013 at 1:36 PM, Rebecca Bennett <[email protected]>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
>> [email protected]
>> http://lists.osgeo.org/mailman/listinfo/grass-user
>>
>
>
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();
_______________________________________________
grass-dev mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/grass-dev

Reply via email to