[GRASS-user] KEYLINE; installing new module add-on (of 7.8) in GRASS 7.6

Enrico Gabrielli bonushenricus bonushenricus76 at gmail.com
Tue Mar 9 08:10:42 PST 2021


Sorry Stefan
I'm a real fool
In the north-south direction the values are the same
while when the direction is different, oblique, the right is yours,
because the mapcalc formula is based only on the resolution of the
raster, not on the actual distance !!
Thank you very much for the work: very useful

Il giorno mar, 09/03/2021 alle 16.23 +0100, Enrico Gabrielli
bonushenricus ha scritto:
> Thanks Stefanobviously this is how it works. I was lost in a drop of
> water.But I don't understand how the module works:below the
> comparison of the results
> betweenr.mapcalc="slope_dir= abs(atan(tan(slope) * cos(aspect -
> direction)))
> isr.slope.direction with step 1
> i tried to read python but i don't understand exactly what it does,
> and also what 45degree means
> Il giorno mar, 09/03/2021 alle 13.35 +0000, Stefan Blumentrath ha
> scritto:
> > Hi again,
> >  
> > Yes, this seems to be a Python2/3 issue. Good suggestions from
> > Vero.
> > Enrico, can also try to replace python3 with just python in the
> > shebang (first line in the script)?
> >  
> > Cheers
> > Stefan
> >  
> > From: Veronica Andreo <veroandreo at gmail.com>
> > 
> > 
> > Sent: mandag 8. mars 2021 12:38
> > 
> > To: Enrico Gabrielli bonushenricus <bonushenricus76 at gmail.com>
> > 
> > Cc: Stefan Blumentrath <Stefan.Blumentrath at nina.no>; 
> > grass-user at lists.osgeo.org
> > 
> > Subject: Re: [GRASS-user] KEYLINE; installing new module add-on (of
> > 7.8) in GRASS 7.6
> >  
> > 
> > 
> > Hi Enrico, 
> > 
> > 
> > 
> >  
> > 
> > 
> > GRASS 7.6 is the last using python 2, and in 7.8 we moved to python
> > 3, though still supporting python 2. Could that be a problem?
> > 
> > 
> > 
> >  
> > 
> > 
> > What about compiling GRASS 7.8+ if not in the Debian stable repos? 
> > 
> > 
> > 
> > https://grasswiki.osgeo.org/wiki/Compile_and_Install#Debian
> > 
> > 
> >  
> > 
> > 
> > my 0.2 cents
> > 
> > 
> > Vero
> > 
> > 
> >  
> > 
> > 
> > El lun, 8 mar 2021 a las 11:37, Enrico Gabrielli bonushenricus (<
> > bonushenricus76 at gmail.com>) escribió:
> > 
> > > Thanks
> > > 
> > > some problems:
> > > 
> > > > File "/home/bonushenricus/.grass7/addons/scripts/r.slope.d
> > > 
> > > > irection.py", line 291, in <module>
> > > 
> > > >     options, flags = gscript.parser()
> > > 
> > > >   File "/usr/lib/grass76/etc/python/grass/script/core.py",
> > > 
> > > > line 800, in parser
> > > 
> > > >     return _parse_opts(lines[1:])
> > > 
> > > >   File "/usr/lib/grass76/etc/python/grass/script/core.py",
> > > 
> > > > line 751, in _parse_opts
> > > 
> > > >     os.environ[var] = val
> > > 
> > > >   File "/usr/lib/python3.7/os.py", line 682, in __setitem__
> > > 
> > > >     key = self.encodekey(key)
> > > 
> > > >   File "/usr/lib/python3.7/os.py", line 753, in encode
> > > 
> > > >     raise TypeError("str expected, not %s" %
> > > 
> > > > type(value).__name__)
> > > 
> > > > TypeError: str expected, not bytes
> > > 
> > > It seems that the files are all there, but perhaps they must be
> > > 
> > > updated. That's pity. Alternatively I will use MAPCALC with
> > > 
> > > ABS (ATAN (TAN (slope) * COS (aspect - raster_direction)))
> > > 
> > > but unfortunately with an extra passage and without the
> > > possibility of
> > > 
> > > defining calculation steps.
> > > 
> > > 
> > > 
> > > 
> > > 
> > > Il giorno lun, 08/03/2021 alle 09.04 +0000, Stefan Blumentrath ha
> > > 
> > > scritto:
> > > 
> > > > Hm, maybe some fixes for g.extension should be backported to
> > > 7.6...
> > > 
> > > > 
> > > 
> > > > Anyway, as a workaround, you can just save the python script
> > > from (as
> > > 
> > > > r.slope.direction 
> > > 
> > > > 
> > > https://raw.githubusercontent.com/OSGeo/grass-addons/master/grass7/raster/r.slope.direction/r.slope.direction.py
> > > 
> > > > ) to:
> > > 
> > > > ~/.grass7/addons/scripts/
> > > 
> > > > 
> > > 
> > > > Then make it executable:
> > > 
> > > > chmod u+x ~/.grass7/addons/scripts/r.slope.direction
> > > 
> > > > 
> > > 
> > > > And it should work...
> > > 
> > > > 
> > > 
> > > > Cheers
> > > 
> > > > Stefan
> > > 
> > > > 
> > > 
> > > > -----Original Message-----
> > > 
> > > > From: Enrico Gabrielli bonushenricus <bonushenricus76 at gmail.com
> > > >
> > > 
> > > 
> > > > Sent: mandag 8. mars 2021 09:44
> > > 
> > > > To: Stefan Blumentrath <Stefan.Blumentrath at nina.no>;
> > > 
> > > 
> > > > grass-user at lists.osgeo.org
> > > 
> > > > Subject: Re: [GRASS-user] KEYLINE; installing new module add-on 
> > > (of
> > > 
> > > > 7.8) in GRASS 7.6
> > > 
> > > > 
> > > 
> > > > Hi Stefan
> > > 
> > > > and thanks
> > > 
> > > > Thanks to all and all developers! And here I have the answer
> > > directly
> > > 
> > > > from those who have developed R-Slope.Direction, no ??
> > > 
> > > > Here's what happens:
> > > 
> > > > > g.extension extension=r.slope.direction
> > > 
> > > > > operation=add                           
> > > 
> > > > > Fetching <r.slope.direction> from GRASS GIS Addons repository
> > > (be 
> > > 
> > > > > patient)...
> > > 
> > > > > ERROR: Extension <r.slope.direction> not found
> > > 
> > > > 
> > > 
> > > > Il giorno lun, 08/03/2021 alle 08.38 +0000, Stefan Blumentrath
> > > ha
> > > 
> > > > scritto:
> > > 
> > > > > Hi Enrico,
> > > 
> > > > > 
> > > 
> > > > > GRASS 7.6 should not be a limiting factor. Did you try to
> > > install
> > > 
> > > > > the 
> > > 
> > > > > addon through g.extension?
> > > 
> > > > > 
> > > 
> > > > > g.extension extension=r.slope.direction operation=add
> > > 
> > > > > 
> > > 
> > > > > If not, please try. If you did but get an error message,
> > > please 
> > > 
> > > > > provide the error message you got...
> > > 
> > > > > 
> > > 
> > > > > Cheers
> > > 
> > > > > Stefan
> > > 
> > > > > 
> > > 
> > > > > 
> > > 
> > > > > -----Original Message-----
> > > 
> > > > > From: grass-user <grass-user-bounces at lists.osgeo.org> On
> > > Behalf Of
> > > 
> > > 
> > > > > Enrico Gabrielli bonushenricus
> > > 
> > > > > Sent: søndag 7. mars 2021 23:59
> > > 
> > > > > To: grass-italia at listserv.unipr.it;
> > > grass-user at lists.osgeo.org
> > > 
> > > > > Subject: [GRASS-user] KEYLINE; installing new module add-on
> > > (of
> > > 
> > > > > 7.8) 
> > > 
> > > > > in GRASS 7.6
> > > 
> > > > > 
> > > 
> > > > > Hello everyone and everyone.
> > > 
> > > > > I write maybe once every one or two years!
> > > 
> > > > > I am a geographer and agricultural consultant.
> > > 
> > > > > I am using GRASS to design in KeyLine (you can easily find
> > > news
> > > 
> > > > > about 
> > > 
> > > > > this ingenious technique, which is also the basis of
> > > permaculture,
> > > 
> > > > > on 
> > > 
> > > > > the internet).
> > > 
> > > > > I found that in GRASS 7.8 there is a new add-on module
> > > called 
> > > 
> > > > > r.slope.direction which would be very useful for keyline
> > > designs.
> > > 
> > > > > Unfortunately I use Debian stable, and therefore GRASS 7.6.
> > > 
> > > > > I have tried to use the r.slope.direction source script which
> > > I
> > > 
> > > > > find 
> > > 
> > > > > here
> > > 
> > > > > 
> > > https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgith
> > > 
> > > > > 
> > > ub.com%2FOSGeo%2Fgrass-
> > > 
> > > > > addons%2Ftree%2Fmaster%2Fgrass7%2Fraster%2Fr.sl
> > > 
> > > > >
> > > ope.direction&data=04%7C01%7C%7C6f03009d912c4bed9a9e08d8e20e5
> > > a2
> > > 
> > > > > 0%7
> > > 
> > > > >
> > > C6cef373021314901831055b3abf02c73%7C0%7C0%7C637507898555085492%7C
> > > Un
> > > 
> > > > > kno
> > > 
> > > > >
> > > wn%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1h
> > > aW
> > > 
> > > > > wiL
> > > 
> > > > >
> > > CJXVCI6Mn0%3D%7C1000&sdata=QpindTE6R0zQP6ArlP9rc2d3nFOYLMHhwt
> > > Dn
> > > 
> > > > > iM8
> > > 
> > > > > EksA%3D&reserved=0 but can't use it. If I install it
> > > following
> > > 
> > > > > the 
> > > 
> > > > > instructions I find here
> > > 
> > > > > 
> > > https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgras
> > > 
> > > > > 
> > > swiki.osgeo.org%2Fwiki%2FGRASS_and_Python%23Installation&data
> > > =0
> > > 
> > > > > 4%7
> > > 
> > > > >
> > > C01%7C%7C6f03009d912c4bed9a9e08d8e20e5a20%7C6cef37302131490183105
> > > 5b
> > > 
> > > > > 3ab
> > > 
> > > > >
> > > f02c73%7C0%7C0%7C637507898555085492%7CUnknown%7CTWFpbGZsb3d8eyJWI
> > > jo
> > > 
> > > > > iMC
> > > 
> > > > >
> > > 4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&a
> > > mp
> > > 
> > > > > ;sd
> > > 
> > > > >
> > > ata=1%2BzzVwsIW7mBcsBvuI%2Bvt2c7yULb%2B2oioSZCcAH1yUU%3D&rese
> > > rv
> > > 
> > > > > ed=
> > > 
> > > > > 0 it gives me several errors. I created the directory in /
> > > usr /
> > > 
> > > > > lib /
> > > 
> > > > > grass76 / scripts /
> > > 
> > > > > I can attach the result of the terminal.
> > > 
> > > > > But if you think that it is simply not easy to install in
> > > GRASS 7.6
> > > 
> > > > > it 
> > > 
> > > > > will mean that I will be looking forward to Debian 11 (I
> > > never
> > > 
> > > > > install
> > > 
> > > > > testing)
> > > 
> > > > > --
> > > 
> > > > > Perito agrario Enrico Gabrielli
> > > 
> > > > > Tessera n. 633 Collegio Periti agrari prov. Di Modena
> > > Biblioteca
> > > 
> > > > > agricoltura: 
> > > 
> > > > > 
> > > https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.
> > > 
> > > > > 
> > > zotero.org%2Fgroups%2Faplomb%2F&data=04%7C01%7C%7C6f03009d912
> > > c4
> > > 
> > > > > bed
> > > 
> > > > >
> > > 9a9e08d8e20e5a20%7C6cef373021314901831055b3abf02c73%7C0%7C0%7C637
> > > 50
> > > 
> > > > > 789
> > > 
> > > > >
> > > 8555085492%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2
> > > lu
> > > 
> > > > > MzI
> > > 
> > > > >
> > > iLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=kW8u9MG0ZAcaWy%2
> > > BW
> > > 
> > > > > nII
> > > 
> > > > > C%2F8KEZrchtuvGzZt0KegMGDg%3D&reserved=0
> > > 
> > > > > 
> > > https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fit.l
> > > 
> > > > > 
> > > inkedin.com%2Fpub%2Fenrico-
> > > 
> > > > > gabrielli%2F9a%2F186%2F159&data=04%7C01
> > > 
> > > > >
> > > %7C%7C6f03009d912c4bed9a9e08d8e20e5a20%7C6cef373021314901831055b3
> > > ab
> > > 
> > > > > f02
> > > 
> > > > >
> > > c73%7C0%7C0%7C637507898555085492%7CUnknown%7CTWFpbGZsb3d8eyJWIjoi
> > > MC
> > > 
> > > > > 4wL
> > > 
> > > > >
> > > jAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&
> > > sd
> > > 
> > > > > ata
> > > 
> > > > >
> > > =%2BudmXF9XutKPUBRmxCFM0J6Y1vUjy00sgNHxN4sea4Y%3D&reserved=0
> > > 
> > > > > 
> > > https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fenri
> > > 
> > > > > 
> > > cogabrielli76.wordpress.com%2F&data=04%7C01%7C%7C6f03009d912c
> > > 4b
> > > 
> > > > > ed9
> > > 
> > > > >
> > > a9e08d8e20e5a20%7C6cef373021314901831055b3abf02c73%7C0%7C0%7C6375
> > > 07
> > > 
> > > > > 898
> > > 
> > > > >
> > > 555095485%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2l
> > > uM
> > > 
> > > > > zIi
> > > 
> > > > >
> > > LCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=Ln9qjq1Zp3rZOOE9a
> > > Gm
> > > 
> > > > > GAs
> > > 
> > > > > %2BLDMytIfH1QY6jYF%2FNjDg%3D&reserved=0
> > > 
> > > > > 
> > > https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.
> > > 
> > > > > 
> > > inaturalist.org%2Fobservations%2Fbonushenricus&data=04%7C01%7
> > > C%
> > > 
> > > > > 7C6
> > > 
> > > > >
> > > f03009d912c4bed9a9e08d8e20e5a20%7C6cef373021314901831055b3abf02c7
> > > 3%
> > > 
> > > > > 7C0
> > > 
> > > > >
> > > %7C0%7C637507898555095485%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjA
> > > wM
> > > 
> > > > > DAi
> > > 
> > > > >
> > > LCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=j
> > > T5
> > > 
> > > > > gKt
> > > 
> > > > > czQ1yxYVfm7eiUGlHFbzjUktUJFU6zynjGZPM%3D&reserved=0
> > > 
> > > > > skype: enricogabrielli (enricogabrielli76.peragr at gmail.com)
> > > 
> > > > > 
> > > 
> > > > > _______________________________________________
> > > 
> > > > > grass-user mailing list
> > > 
> > > > > grass-user at lists.osgeo.org
> > > 
> > > > > 
> > > https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Flist
> > > 
> > > > > 
> > > s.osgeo.org%2Fmailman%2Flistinfo%2Fgrass-
> > > 
> > > > > user&data=04%7C01%7C%7C6f
> > > 
> > > > >
> > > 03009d912c4bed9a9e08d8e20e5a20%7C6cef373021314901831055b3abf02c73
> > > %7
> > > 
> > > > > C0%
> > > 
> > > > >
> > > 7C0%7C637507898555095485%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAw
> > > MD
> > > 
> > > > > AiL
> > > 
> > > > >
> > > CJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=%2
> > > Bh
> > > 
> > > > > k3a
> > > 
> > > > > uCu5tEI6v3nZBKwWPzrw%2F48XwetrtW9lEwTOj8%3D&reserved=0
> > > 
> > > 
> > > 
> > > _______________________________________________
> > > 
> > > grass-user mailing list
> > > 
> > > grass-user at lists.osgeo.org
> > > 
> > > https://lists.osgeo.org/mailman/listinfo/grass-user
> > 
> > 
> > 
> > 
> 
> 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/grass-user/attachments/20210309/95738324/attachment-0003.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: r.slope.png
Type: image/png
Size: 9632 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/grass-user/attachments/20210309/95738324/attachment-0006.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: rmapcalc.png
Type: image/png
Size: 9339 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/grass-user/attachments/20210309/95738324/attachment-0007.png>


More information about the grass-user mailing list