Re: [GRASS-dev] [GRASS-user] Example project for a GRASS GIS module on GitHub

2020-01-30 Thread Stefan Blumentrath
Hi,

Great work, Vasek!

I found the gitlab version already very useful and I can just recommend it for 
any addon-dev to use as a starting point!
Esp. for beginners and autodidacts like me it is very valuable to see 
everything (and esp. the manual) checked, so a working version can be finally 
submitted to grass-addons.

In other words, r.example.plus is a perfect sandbox!

Cheers
Stefan



From: grass-user  On Behalf Of Vaclav Petras
Sent: torsdag 30. januar 2020 02:31
To: grass-dev@lists.osgeo.org; GRASS user list 
Subject: [GRASS-user] Example project for a GRASS GIS module on GitHub

Dear users and contributors,

I've created an example project (repository) on GitHub. It is a GRASS GIS 
module written in Python which simply adds two raster maps together. It uses 
GitHub Actions to build the module and publish its documentation as a website 
(using GitHub Pages).

https://github.com/wenzeslaus/r.example.plus

This is based on my earlier work on an example project on GitLab [1] and 
includes several improvements and changes:

* There is a test suite included with couple of test functions.
* It uses Black for code formatting (assuming author runs it manually).
* Repository is marked as a template (see the big "Use this template" button).
* GitHub Actions are used for:
  * compiling the module and running tests,
  * checking code quality with Flake8 and Pylint, and
  * checking code style with Black.
* GitHub Actions are now used for publishing documentation (done by GitLab CI 
before).
* Option names now follow GRASS GIS standards more.
* More documentation in the code and on how to use the code.
* Badges are now in the README file (GitLab had those as project properties).

Otherwise, I hope the project should describe itself and if something is 
missing or is not documented enough, please open an issue or a pull request.

Best,
Vaclav

PS: We can discuss on grass-dev if this should go under some organization and 
how to improve the "what's next" part [2].

[1] https://lists.osgeo.org/pipermail/grass-dev/2018-November/090438.html
[2] https://github.com/wenzeslaus/r.example.plus#what-is-next

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

Re: [GRASS-dev] r.slope.aspect with -n flag giving aspect of flat areas as -9998

2020-01-30 Thread Markus Metz
On Tue, Jan 28, 2020 at 12:50 PM Pedro VenĂ¢ncio 
wrote:
>
> Hi all,
>
> I was testing r.slope.aspect with the "new" -n flag, also to include -e
and -n flags in QGIS Processing, but -n flag is giving aspect values of
flat areas as -9998, instead of -, when the precision choosed is CELL,
and the output data type is CELL.

that seems to be a rounding error, even though float or double should be
able to represent - exactly. Should be easy to fix.

Markus M
>
> https://grass.osgeo.org/grass78/manuals/r.slope.aspect.html
>
> I've tested with GRASS 7.6 (on Linux) and GRASS 7.8.2 (on Windows), both
in the GUI and CLI.
>
> (Tue Jan 28 11:19:40 2020)

> r.slope.aspect -e -n --verbose elevation=SRTM_PT_25m@PERMANENT
slope=SRTM_PT_25m_Slope_Deg_GRASS aspect=SRTM_PT_25m_Aspect_Std_GRASS
precision=CELL
> Percent complete...
> Elevation products for mapset  in 
> Min computed aspect 0., max computed aspect 360.
> Aspect raster map  complete
> Min computed slope 0., max computed slope 75.2970
> Slope raster map  complete
> (Tue Jan 28 11:20:24 2020) Comando terminado (43 sec)
>
> r.info map=SRTM_PT_25m_Aspect_Std_GRASS@PERMANENT

>
 ++
>  | Map:  SRTM_PT_25m_Aspect_Std_GRASS@  Date: Tue Jan 28 11:20:24
2020|
>  | Mapset:   PERMANENT  Login of Creator:
PedroVenancio   |
>  | Location: SRTM_PT_25m
 |
>  | DataBase: D:\ICNF\Modelos_Combustivel_2018\Landscape_File\grass78
 |
>  | Title:Aspect counterclockwise in degrees from east
|
>  | Timestamp: none
 |
>
 ||
>  |
 |
>  |   Type of Map:  raster   Number of Categories: 360
|
>  |   Data Type:CELL
|
>  |   Rows: 23200
 |
>  |   Columns:  11360
 |
>  |   Total Cells:  263552000
 |
>  |Projection: ETRS89 / Portugal TM06
 |
>  |N: 278000S:-302000   Res:25
|
>  |E: 164000W:-12   Res:25
|
>  |   Range of data:min = -9998  max = 360
|
>  |
 |
>  |   Data Source:
|
>  |raster elevation file SRTM_PT_25m@PERMANENT
|
>  |
 |
>  |
 |
>  |   Data Description:
 |
>  |generated by r.slope.aspect
|
>  |
 |
>  |   Comments:
 |
>  |aspect map elev = SRTM_PT_25m@PERMANENT
|
>  |zfactor = 1.00
 |
>  |min_slope = 0.00
 |
>  |
 |
>  |r.slope.aspect --verbose -e -n elevation="SRTM_PT_25m@PERMANENT"
slo\   |
>  |pe="SRTM_PT_25m_Slope_Deg_GRASS"
aspect="SRTM_PT_25m_Aspect_Std_GRAS\   |
>  |S" format="degrees" precision="CELL" zscale=1.0 min_slope=0.0
|
>  |
 |
>
 ++
> (Tue Jan 28 11:26:09 2020) Comando terminado (0 sec)

>
>
> Using the default precision as FCELL, all goes ok:
>
> (Tue Jan 28 11:33:08 2020)

> r.slope.aspect -e -n --verbose elevation=SRTM_PT_25m@PERMANENT
slope=SRTM_PT_25m_Slope_Deg_GRASS_2 aspect=SRTM_PT_25m_Aspect_Std_GRASS_2
> Percent complete...
> Elevation products for mapset  in 
> Min computed aspect 0., max computed aspect 359.8096
> Aspect raster map  complete
> Min computed slope 0., max computed slope 75.2970
> Slope raster map  complete
> (Tue Jan 28 11:34:01 2020) Comando terminado (53 sec)
>
> (Tue Jan 28 11:34:27 2020)

> r.info map=SRTM_PT_25m_Aspect_Std_GRASS_2@PERMANENT

>
 ++
>  | Map:  SRTM_PT_25m_Aspect_Std_GRASS_  Date: Tue Jan 28 11:34:01
2020|
>  | Mapset:   PERMANENT  Login of Creator:
PedroVenancio   |
>  | Location: SRTM_PT_25m
 |
>  | DataBase: D:\ICNF\Modelos_Combustivel_2018\Landscape_File\grass78
 |
>  | Title:Aspect counterclockwise in degrees from east
|
>  | Timestamp: none
 |
>
 ||
>  |
 |
>  |   Type of Map:  raster   Number of Categories: 360
|
>  |   Data Type:FCELL
 |
>  |   Rows: 23200
 |
>  |   Columns:  11360
 |
>  |   Total Cells:  263552000
 |
>  |Projection: ETRS89 / Portugal TM06
 |
>  |N: 278000S:-302000   Res:25
|
>  |E: 164000W:-12   Res:25
|
>  |   Range of data:min = -  max = 359.8097
 |
>  |
 |
>  |   Data Source:
|
>  |raster elevation file SRTM_PT_25m@PERMANENT
|
>  |
 |
>  |
 |
>  |   Data Description:
 |
>  |generated by r.slope.aspect
|
>  |
 |
>  |   Comments:
 |
>  |aspect map elev = SRTM_PT_25m@PERMANENT
|
>  |zfactor = 1.00
 |
>  |min_slope = 0.00
 |
>  |
 |
>  |r.slope.aspect --verbose -e -n elevation="SRTM_PT_25m@PERMANENT"
slo\   |
>  |pe="SRTM_PT_25m_Slope_Deg_GRASS_2"