Re: [GRASS-user] Probabilistic neighborhood analysis

2023-01-09 Thread Maris Nartiss
Hello Bernardo,
although a solution with r.mapcalc random could be made to work, I'd
say creating a new dedicated module is the way to go. Just an idea –
create neighbour count raster (how many cells with centre class are in
a sliding window), in second pass unroll classes based on their count
and then choose random class from obtained list.

I don't think it is so common to infill (inpaint) categorical values
in classification results of remote sensing.
Māris.

pirmd., 2023. g. 9. janv., plkst. 13:18 — lietotājs Bernardo Santos
via grass-user () rakstīja:
>
> Hi Ken,
>
> The fuzzy logic tools seem interesting! But I am new to the concept so I did 
> not really think about how could I set functions/rules that increase with the 
> frequency of a land cover class...
> Do you know any example in this context?
>
> I thought that people working with satellite imagery classification and cloud 
> cover would have experience with that, since sometimes it is necessary to 
> somehow interpolate and fill values cover by clouds...
>
> Best
> B
>
> Em segunda-feira, 26 de dezembro de 2022 16:50:42 GMT+1, Ken Mankoff 
>  escreveu:
>
>
> What about using the fuzzy logic modules?
>
>   -k.
>
> Please excuse brevity. Sent from tiny pocket computer with non-haptic 
> feedback keyboard.
>
> On Wed, Dec 14, 2022, 13:38 Bernardo Santos via grass-user 
>  wrote:
>
> Hi,
>
> I am trying to produce scenarios of past land cover, before hydropower 
> reservoirs were built. To do so, I need to fill empty pixels from a raster in 
> the locations where the reservoirs are currently present, using as input the 
> actual land cover map. I tried doing that with r.neighbors (taking 
> method=mode) with neighborhoods of increasing size, to replace null pixels 
> with the most common land cover class in the neighborhood. I also tried that 
> with r.fill.stats which is basically the same thing.
> However, the results gets very homogeneous, since the interpolated null cells 
> always get the value of the most common land cover class.
>
> Do anyway know of a method in GRASS to perform a "probabilistic" 
> neirighborhood analysis, where cells in a neighborhood are given weights 
> (possibly related to the distance to the central cell and to their frequency) 
> and these weights are used to stocastically sample a value to fill the 
> central cell?
> If not in GRASS, does anyway know of such a method in a different platform, 
> i.e. R?
>
> Thanks!
> Best
> Bernardo
> ___
> grass-user mailing list
> grass-user@lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/grass-user
>
> ___
> grass-user mailing list
> grass-user@lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/grass-user
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user


Re: [GRASS-user] How to use g.extension in GRASS7.8

2023-01-09 Thread Stefan Blumentrath
Hei Bernardo,

The problem is likely that the layout of the addon repo changed after 7.8.5, 
thus the path is not constructed correctly by g.extension in that version.

A workaround could be to fetch the add on repo with git (git clone 
https://github.com/osgeo/grass-addons)

And then point g.extension to your local copy:
g.extension extension=r.area url=./grass-addons/src/raster/r.area

You may need a zip file, but you can try the above first...

Good luck.. 

Cheers,
Stefan

> Gesendet: Montag, den 09.01.2023 um 21:14 Uhr
> Von: "Bernardo Santos via grass-user" 
> An: "Markus Neteler" 
> Cc: "GRASS User List" 
> Betreff: Re: [GRASS-user] How to use g.extension in GRASS7.8
> 
>  Hi Markus and Vero,
> Thanks. Indeed, my GRASS version is old:GRASS 7.8.5Ubuntu 18.04.6 LTS
> I unfortunately do not have a way to upgrade it myself since this is a 
> company server shared with other people (and we have been fighting with IT to 
> change to GRASS 8).But maybe it is easier to at lease update GRASS to version 
> 7.8.7 (or 7.8.8).
> I just talked to a colleague (@mauricio.vancince) who mentioned he had the 
> same problem but could overcome it opening the terminal as a superuser and 
> using g.extension r.area -sUnfortunately I do not have admin rights, but I 
> will see what is possible to be done.
> Thanks!BestBernardo 
> Em segunda-feira, 9 de janeiro de 2023 15:19:07 GMT+1, Markus Neteler 
>  escreveu:  
>  
>  Hi Bernardo,
> 
> On Mon, Jan 9, 2023 at 2:58 PM Bernardo Santos
>  wrote:
> >
> > Hi Markus,
> >
> > That was my first try, and then I get the error below:
> >
> > > g.extension extension=r.area
> > Fetching  from GRASS GIS Addons repository (be patient)...
> > svn: E17: URL 
> > 'https://github.com/OSGeo/grass-addons/trunk/grass7/raster/r.area' doesn't 
> > exist
> > ERROR: GRASS Addons  not found
> 
> Ah right. Then your GRASS GIS 7.8 version may be too old. G 7.8.7
> should be ok (G 7.8.8 is on the way these days) but in any case, as
> Vero pointed out, we highly recommend to upgrade to GRASS GIS 8.2.x.
> 
> Best,
> Markus
>   ___
> grass-user mailing list
> grass-user@lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/grass-user
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user


Re: [GRASS-user] How to use g.extension in GRASS7.8

2023-01-09 Thread Bernardo Santos via grass-user
 Hi Markus and Vero,
Thanks. Indeed, my GRASS version is old:GRASS 7.8.5Ubuntu 18.04.6 LTS
I unfortunately do not have a way to upgrade it myself since this is a company 
server shared with other people (and we have been fighting with IT to change to 
GRASS 8).But maybe it is easier to at lease update GRASS to version 7.8.7 (or 
7.8.8).
I just talked to a colleague (@mauricio.vancince) who mentioned he had the same 
problem but could overcome it opening the terminal as a superuser and using 
g.extension r.area -sUnfortunately I do not have admin rights, but I will see 
what is possible to be done.
Thanks!BestBernardo 
Em segunda-feira, 9 de janeiro de 2023 15:19:07 GMT+1, Markus Neteler 
 escreveu:  
 
 Hi Bernardo,

On Mon, Jan 9, 2023 at 2:58 PM Bernardo Santos
 wrote:
>
> Hi Markus,
>
> That was my first try, and then I get the error below:
>
> > g.extension extension=r.area
> Fetching  from GRASS GIS Addons repository (be patient)...
> svn: E17: URL 
> 'https://github.com/OSGeo/grass-addons/trunk/grass7/raster/r.area' doesn't 
> exist
> ERROR: GRASS Addons  not found

Ah right. Then your GRASS GIS 7.8 version may be too old. G 7.8.7
should be ok (G 7.8.8 is on the way these days) but in any case, as
Vero pointed out, we highly recommend to upgrade to GRASS GIS 8.2.x.

Best,
Markus
  ___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user


[GRASS-user] Mini project 2023: Week 5: Improving Single-Window GUI user experience

2023-01-09 Thread Linda Kladivová


Hello guys,




I am sending my fifth report regarding the GRASS mini-project which is also
available here: [1].




1) What did I complete this week?
The PR ​(https://github.com/OSGeo/grass/pull/2682)[2] implementing the
Export history button in the Console pane was merged.




The first part of the week I worked on PR [3] which adds an input prompt 
sign to the command prompt widget. However, although it was our suggestion
from ​(https://github.com/OSGeo/grass/issues/2585)[4], the intervention into
the command prompt showed programmatically as very unfortunate - it was 
really hard to cover all cases of how the text in the command prompt could
be managed. So, we decided to implement the task differently by showing a 
hint in the case that the command prompt is not focused. I think it is an 
even more user-friendly solution. It is already prepared for merging (see ​
(https://github.com/OSGeo/grass/pull/2728)[5]).





Meanwhile, I worked on adding "isDocked" parameter to workspace handling in
the PR ​(https://github.com/OSGeo/grass/pull/2667)[6] dealing with dock/
undock map display functionality. It was the thing I forget to consider. 
However, the workspace issue revealed an error in ​
(https://github.com/OSGeo/grass/pull/2667)[6] related to closing undocked 
map display frame.





2) What am I going to achieve for next week?

The goal for the next week is to merge both - [5] and [6]. Then I plan to 
create a PR on the Console reorganization according to the suggestion in ​
(https://github.com/OSGeo/grass/issues/2585)[4].





3) Is there any blocking issue?


There is one blocking error in [6] related to the closing of undocked map 
display frame (wrapped C/C++ object of type MapPageFrame has been deleted).
I have already spent several hours to fix it but unsuccessfully. I will 
probably put it off now and go back later, with more ideas in my mind.





Have a nice week,





Linda





[1] https://trac.osgeo.org/grass/wiki/wxGUIDevelopment/
ImprovingSingleWindowUX
(https://trac.osgeo.org/grass/wiki/wxGUIDevelopment/ImprovingSingleWindowUX)

[2] https://github.com/OSGeo/grass/pull/2682
(https://github.com/OSGeo/grass/pull/2682)

[3] ​(https://github.com/OSGeo/grass/pull/2153)https://github.com/OSGeo/
grass/pull/2718(https://github.com/OSGeo/grass/pull/2682)

[4] https://github.com/OSGeo/grass/issues/2585
(https://github.com/OSGeo/grass/issues/2585)

[5] https://github.com/OSGeo/grass/pull/2728
(https://github.com/OSGeo/grass/pull/2728)

[6] https://github.com/OSGeo/grass/pull/2667
(https://github.com/OSGeo/grass/pull/2667)___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user


Re: [GRASS-user] How to use g.extension in GRASS7.8

2023-01-09 Thread Markus Neteler
Hi Bernardo,

On Mon, Jan 9, 2023 at 2:58 PM Bernardo Santos
 wrote:
>
> Hi Markus,
>
> That was my first try, and then I get the error below:
>
> > g.extension extension=r.area
> Fetching  from GRASS GIS Addons repository (be patient)...
> svn: E17: URL 
> 'https://github.com/OSGeo/grass-addons/trunk/grass7/raster/r.area' doesn't 
> exist
> ERROR: GRASS Addons  not found

Ah right. Then your GRASS GIS 7.8 version may be too old. G 7.8.7
should be ok (G 7.8.8 is on the way these days) but in any case, as
Vero pointed out, we highly recommend to upgrade to GRASS GIS 8.2.x.

Best,
Markus
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user


Re: [GRASS-user] How to use g.extension in GRASS7.8

2023-01-09 Thread Veronica Andreo
Which GRASS 7.8 you have and which operating system? Any chances you can
update to GRASS 8.2?

El lun, 9 ene 2023 a las 10:58, Bernardo Santos via grass-user (<
grass-user@lists.osgeo.org>) escribió:

> Hi Markus,
>
> That was my first try, and then I get the error below:
>
> > g.extension extension=r.area
> Fetching  from GRASS GIS Addons repository (be patient)...
> svn: E17: URL '
> https://github.com/OSGeo/grass-addons/trunk/grass7/raster/r.area' doesn't
> exist
> ERROR: GRASS Addons  not found
>
> B
>
> Em segunda-feira, 9 de janeiro de 2023 14:35:48 GMT+1, Markus Neteler <
> nete...@osgeo.org> escreveu:
>
>
> Hi,
>
> On Mon, Jan 9, 2023 at 11:50 AM Bernardo Santos via grass-user
>  wrote:
> >
> > Hi,
> >
> > I am trying to install the extension r.area using the g.extension tool
> in GRASS 7.8.
> > However, I get the error that it was not found in the Github repo
> (because the repo changed).
> > Here the error:
> >
> > > g.extension extension=r.area
> > Fetching  from GRASS GIS Addons repository (be patient)...
> > svn: E17: URL 
> > 'https://github.com/OSGeo/grass-addons/trunk/grass7/raster/r.area'
> doesn't exist
> > ERROR: GRASS Addons  not found
> >
> > I tried adding url=
> https://github.com/OSGeo/grass-addons/tree/grass8/src/raster/r.area; but
> it also does not work:
> > > g.extension extension=r.area url=
> https://github.com/OSGeo/grass-addons/tree/grass8/src/raster/r.area
> >  The command:
> > g.extension extension=r.area 
> > url=https://github.com/OSGeo/grass-addons/tree/grass8/src/raster/r.area
> operation=add
> > produced an error (1) during execution:
> > Fetching  from
> > <
> https://github.com/OSGeo/grass-addons/tree/grass8/src/raster/r.area/archive/master.zip
> >
> > (be patient)...
> > ERROR: Extension  not found
> >
> > How should I proceed to install it in GRASS 7.8?
>
> It should work like this (g.extension will figure out the correct path):
>
> g.extension extension=r.area
>
> HTH,
> Markus
>
> PS: Full path is only needed when the addon isn't part of the standard
> addon repository but found elsewhere.
> ___
> grass-user mailing list
> grass-user@lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/grass-user
>
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user


Re: [GRASS-user] How to use g.extension in GRASS7.8

2023-01-09 Thread Bernardo Santos via grass-user
 Hi Markus,
That was my first try, and then I get the error below:
> g.extension extension=r.areaFetching  from GRASS GIS Addons 
> repository (be patient)...svn: E17: URL 
> 'https://github.com/OSGeo/grass-addons/trunk/grass7/raster/r.area' doesn't 
> existERROR: GRASS Addons  not found
B
Em segunda-feira, 9 de janeiro de 2023 14:35:48 GMT+1, Markus Neteler 
 escreveu:  
 
 Hi,

On Mon, Jan 9, 2023 at 11:50 AM Bernardo Santos via grass-user
 wrote:
>
> Hi,
>
> I am trying to install the extension r.area using the g.extension tool in 
> GRASS 7.8.
> However, I get the error that it was not found in the Github repo (because 
> the repo changed).
> Here the error:
>
> > g.extension extension=r.area
> Fetching  from GRASS GIS Addons repository (be patient)...
> svn: E17: URL 
> 'https://github.com/OSGeo/grass-addons/trunk/grass7/raster/r.area' doesn't 
> exist
> ERROR: GRASS Addons  not found
>
> I tried adding 
> url=https://github.com/OSGeo/grass-addons/tree/grass8/src/raster/r.area; but 
> it also does not work:
> > g.extension extension=r.area 
> > url=https://github.com/OSGeo/grass-addons/tree/grass8/src/raster/r.area
>  The command:
> g.extension extension=r.area 
> url=https://github.com/OSGeo/grass-addons/tree/grass8/src/raster/r.area 
> operation=add
> produced an error (1) during execution:
> Fetching  from
> 
> (be patient)...
> ERROR: Extension  not found
>
> How should I proceed to install it in GRASS 7.8?

It should work like this (g.extension will figure out the correct path):

g.extension extension=r.area

HTH,
Markus

PS: Full path is only needed when the addon isn't part of the standard
addon repository but found elsewhere.
  ___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user


Re: [GRASS-user] How to use g.extension in GRASS7.8

2023-01-09 Thread Markus Neteler
Hi,

On Mon, Jan 9, 2023 at 11:50 AM Bernardo Santos via grass-user
 wrote:
>
> Hi,
>
> I am trying to install the extension r.area using the g.extension tool in 
> GRASS 7.8.
> However, I get the error that it was not found in the Github repo (because 
> the repo changed).
> Here the error:
>
> > g.extension extension=r.area
> Fetching  from GRASS GIS Addons repository (be patient)...
> svn: E17: URL 
> 'https://github.com/OSGeo/grass-addons/trunk/grass7/raster/r.area' doesn't 
> exist
> ERROR: GRASS Addons  not found
>
> I tried adding 
> url=https://github.com/OSGeo/grass-addons/tree/grass8/src/raster/r.area; but 
> it also does not work:
> > g.extension extension=r.area 
> > url=https://github.com/OSGeo/grass-addons/tree/grass8/src/raster/r.area
>  The command:
> g.extension extension=r.area 
> url=https://github.com/OSGeo/grass-addons/tree/grass8/src/raster/r.area 
> operation=add
> produced an error (1) during execution:
> Fetching  from
> 
> (be patient)...
> ERROR: Extension  not found
>
> How should I proceed to install it in GRASS 7.8?

It should work like this (g.extension will figure out the correct path):

g.extension extension=r.area

HTH,
Markus

PS: Full path is only needed when the addon isn't part of the standard
addon repository but found elsewhere.
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user


Re: [GRASS-user] Probabilistic neighborhood analysis

2023-01-09 Thread Bernardo Santos via grass-user
 Hi Ken,
The fuzzy logic tools seem interesting! But I am new to the concept so I did 
not really think about how could I set functions/rules that increase with the 
frequency of a land cover class...Do you know any example in this context?
I thought that people working with satellite imagery classification and cloud 
cover would have experience with that, since sometimes it is necessary to 
somehow interpolate and fill values cover by clouds...
BestB 
Em segunda-feira, 26 de dezembro de 2022 16:50:42 GMT+1, Ken Mankoff 
 escreveu:  
 
 What about using the fuzzy logic modules? 

  -k.

Please excuse brevity. Sent from tiny pocket computer with non-haptic feedback 
keyboard.
On Wed, Dec 14, 2022, 13:38 Bernardo Santos via grass-user 
 wrote:

Hi,
I am trying to produce scenarios of past land cover, before hydropower 
reservoirs were built. To do so, I need to fill empty pixels from a raster in 
the locations where the reservoirs are currently present, using as input the 
actual land cover map. I tried doing that with r.neighbors (taking method=mode) 
with neighborhoods of increasing size, to replace null pixels with the most 
common land cover class in the neighborhood. I also tried that with 
r.fill.stats which is basically the same thing.However, the results gets very 
homogeneous, since the interpolated null cells always get the value of the most 
common land cover class.
Do anyway know of a method in GRASS to perform a "probabilistic" neirighborhood 
analysis, where cells in a neighborhood are given weights (possibly related to 
the distance to the central cell and to their frequency) and these weights are 
used to stocastically sample a value to fill the central cell?If not in GRASS, 
does anyway know of such a method in a different platform, i.e. R?
Thanks!BestBernardo___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

  ___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user


Re: [GRASS-user] Probabilistic neighborhood analysis

2023-01-09 Thread Bernardo Santos via grass-user
 Hi Vero,
Thanks for the suggestion.I tried it, but it only gives different weights to 
the values within the neighborhood according to a distance decay function. 
However, the values are still determined "deterministically".
What I could do is to use the function terra::focal() in R, since within it I 
can define a function to be computed for the neighborhood and use sample() to 
make this operation probabilistic. It seems to work, but it quite time 
consuming though.
BestBernardo
Em segunda-feira, 26 de dezembro de 2022 16:13:02 GMT+1, Veronica Andreo 
 escreveu:  
 
 Hello Bernardo, 

I haven't tested myself, but have you tried r.neighbors with the different 
weight-related options?
Vero

El mié, 14 dic 2022 a las 10:38, Bernardo Santos via grass-user 
() escribió:

Hi,
I am trying to produce scenarios of past land cover, before hydropower 
reservoirs were built. To do so, I need to fill empty pixels from a raster in 
the locations where the reservoirs are currently present, using as input the 
actual land cover map. I tried doing that with r.neighbors (taking method=mode) 
with neighborhoods of increasing size, to replace null pixels with the most 
common land cover class in the neighborhood. I also tried that with 
r.fill.stats which is basically the same thing.However, the results gets very 
homogeneous, since the interpolated null cells always get the value of the most 
common land cover class.
Do anyway know of a method in GRASS to perform a "probabilistic" neirighborhood 
analysis, where cells in a neighborhood are given weights (possibly related to 
the distance to the central cell and to their frequency) and these weights are 
used to stocastically sample a value to fill the central cell?If not in GRASS, 
does anyway know of such a method in a different platform, i.e. R?
Thanks!BestBernardo___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

  ___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user


[GRASS-user] How to use g.extension in GRASS7.8

2023-01-09 Thread Bernardo Santos via grass-user
Hi,
I am trying to install the extension r.area using the g.extension tool in GRASS 
7.8.However, I get the error that it was not found in the Github repo (because 
the repo changed).Here the error:
 > g.extension extension=r.areaFetching  from GRASS GIS Addons 
 > repository (be patient)...svn: E17: URL 
 > 'https://github.com/OSGeo/grass-addons/trunk/grass7/raster/r.area' doesn't 
 > existERROR: GRASS Addons  not found
I tried adding 
url=https://github.com/OSGeo/grass-addons/tree/grass8/src/raster/r.area; but it 
also does not work:> g.extension extension=r.area 
url=https://github.com/OSGeo/grass-addons/tree/grass8/src/raster/r.area The 
command:g.extension extension=r.area 
url=https://github.com/OSGeo/grass-addons/tree/grass8/src/raster/r.area 
operation=addproduced an error (1) during execution:Fetching  
from(be
 patient)...ERROR: Extension  not found
How should I proceed to install it in GRASS 7.8?
BestBernardo
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user