Paulo van Breugel | 22 Jul 08:55 2014
Picon

pygrass vs grass python scripting library

I am trying to familiarize myself a bit with python scripting in GRASS. I am a bit confused about the different approaches that seem possible. More specifically, there is the pygrass (http://grasswiki.osgeo.org/wiki/Python/pygrass) and grass python scripting library (
http://grasswiki.osgeo.org/wiki/GRASS_Python_Scripting_Library). Is there somewhere a concise description explaining the difference between the two. And for writing python scripts (addons), which of these two are a better option to use (for somebody fairly familiar with GRASS, with some experience in writing shell or R scripts for GRASS, but with no experience at all with python).

Cheers,

Paulo


_______________________________________________
grass-dev mailing list
grass-dev <at> lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-dev
Michael Barton | 21 Jul 20:32 2014
Picon

Re: grass-dev Digest, Vol 101, Issue 50

It is also on the GRASS for Mac site and runs fine.


Michael
____________________
C. Michael Barton
Director, Center for Social Dynamics & Complexity 
Professor of Anthropology, School of Human Evolution & Social Change
Head, Graduate Faculty in Complex Adaptive Systems Science
Arizona State University

voice:  480-965-6262 (SHESC), 480-965-8130/727-9746 (CSDC)
fax: 480-965-7671 (SHESC),  480-727-0709 (CSDC)





From: Martin Landa <landa.martin <at> gmail.com>
Subject: Re: [GRASS-dev] grass gis story movie
Date: July 21, 2014 at 6:37:51 AM MST
To: Peter Löwe <peter.loewe <at> gmx.de>
Cc: Markus Neteler <markus.neteler <at> fmach.it>, GRASS developers list <grass-dev <at> lists.osgeo.org>


Hi,

2014-07-15 20:31 GMT+02:00 "Peter Löwe" <peter.loewe <at> gmx.de>:
the GRASS GIS Story has already been uploaded by someone to Youtube (https://www.youtube.com/watch?v=U3Hf0qI4JLc). Uploading it a second time won't do harm, but neither will solve some Youtube-related issues:

Youtube does not allow for advanced search queries on the movies' content: The version already available on Youtube can _not_ be found by the search queries like "GRASS GIS William Shatner". Further, there is no proper way to _cite_ the movie in a publication. In my feeling the movie has already become a historical document for the OSGeo community. In the sense of information preservation it would be good to have a version which long time preserved, citable and fully searchable.

ah, it explains why I didn't find, I put link to [1]. BTW, the local
movie seems to be not playable (at least on my computer).

Martin

[1] http://grass.osgeo.org/HostedVideoAlbums/video/GRASS-History-The-GRASS-Story/15/

-- 
Martin Landa * http://geo.fsv.cvut.cz/gwiki/Landa

_______________________________________________
grass-dev mailing list
grass-dev <at> lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-dev
Markus Neteler | 21 Jul 15:46 2014

PROJSHARE changed to /usr/share/proj from /usr/local/share/proj

Hi,

just FYI: since PROJ4.8 is now widely available and standard, I have
taken liberty to change configure[.in]
from
PROJSHARE=/usr/local/share/proj
to
PROJSHARE=/usr/share/proj

which results now in:
--with-proj-share=/usr/share/proj
being used by default.

Rationale:
This helps to avoid an ugly error message in the location wizard (EPSG
dialog) when GRASS wasn't explicitly compiled with --with-proj-share.

If no objections, I'll backport r61296 to relbr70.

Markus
Swapan Ghosh | 20 Jul 22:47 2014
Picon

r.hazard.flood is not running in windows7( Grass 6.5)

Dear all,

I succesfully the module r.hazards.flood.py in windows xp but fail in windows 7.

Please help me.

Regards,

Swapan Ghosh
_______________________________________________
grass-dev mailing list
grass-dev <at> lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-dev
Vaclav Petras | 20 Jul 06:06 2014
Picon

Re: [GRASS-SVN] r61282 - in grass/trunk: include/defs lib/raster3d lib/raster3d/test


On Sat, Jul 19, 2014 at 8:02 PM, <svn_grass <at> osgeo.org> wrote:
Unfortunately changed the editor that i use the indention and converted
all tabs into spaces at save time. Hence,
the commit contains 95% tab to space conversion noise.

I would actually agree with the change. I think that the GRASS indentation style is a bug since mixed tabs and spaces are enforced as a rule (not just allowed). However, it was decided that it won't be fixed and that current practice should be preserved. [1]

Fortunately, there is a script which can enforce the unusual indent style [2]. And also `svn diff --ignore-space-change` for cases like this commit.

Anyway, I'm glad you discovered and fixed the bug. It is now painful for me to see that tests did not showed the bug. That's maybe why in an ideal world, tests are written by different person than the code (and without access/looking to the source code).

Vaclav
_______________________________________________
grass-dev mailing list
grass-dev <at> lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-dev
Vaclav Petras | 19 Jul 19:18 2014
Picon

Re: [GRASS-SVN] r61280 - in grass/trunk/gui: icons/grass wxpython/lmgr

Hi,

I've realized that an nice icon will save me a lot of time in searching for the right layer/item in layer manager layer tree, so I've just added new icons derived from the SVG version of current icons [1] which are contain only symbol for type of the layer and not unnecessary symbol for layer nor unwanted symbol for add.

I've used size 16x16, although other icons are 24x24 (from what I've checked). The reason is that 24x24 were resampled in very ugly way (this is what also the former icons suffered from). I don't know how to deal with this inconsistency without complete redesign of icon handling in wxGUI.

I'm not sure what to do with SVGs. Should I try to put them to OSGeo repository? Is creating ticket the right way?

Future work is to create this kind of icon for command layer and for grid layer which don't have SVG version in OSGeo repository. Additional future work is to determine if these icons are useful also somewhere else.

This commit should not be backported soon because I'm not sure about side effects because of the way of using the defined icons.

Vaclav

[1] http://svn.osgeo.org/osgeo/graphics/trunk/
[2] trac.osgeo.org/osgeo/browser/graphics/trunk/



On Sat, Jul 19, 2014 at 12:58 PM, <svn_grass <at> osgeo.org> wrote:
>
> Author: wenzeslaus
> Date: 2014-07-19 09:58:44 -0700 (Sat, 19 Jul 2014)
> New Revision: 61280
>
> Added:
>    grass/trunk/gui/icons/grass/aspect-arrow.png
>    grass/trunk/gui/icons/grass/cell-cats.png
>    grass/trunk/gui/icons/grass/his.png
>    grass/trunk/gui/icons/grass/label.png
>    grass/trunk/gui/icons/grass/raster.png
>    grass/trunk/gui/icons/grass/raster3d.png
>    grass/trunk/gui/icons/grass/rgb.png
>    grass/trunk/gui/icons/grass/shaded-relief.png
>    grass/trunk/gui/icons/grass/vector-chart.png
>    grass/trunk/gui/icons/grass/vector-thematic.png
>    grass/trunk/gui/icons/grass/vector.png
>    grass/trunk/gui/icons/grass/wms.png
> Modified:
>    grass/trunk/gui/wxpython/lmgr/layertree.py
> Log:
> wxGUI: icons for layers in lmgr tree without 'layer' and 'add' symbols
>
> Size of icons is 16x16 to avoid imperfect resampling at some (or all) platforms.
> The motivation is to make the icons more useful, they now can actually help to recognize type of layer.
> The commit assumes that the icon objects defined in layertree are used only for layers, not for other things although item label suggests that.
> Command and grid layer still use the layer-xxx-add icon because there is no SVG for them in OSGeo icons (trac.osgeo.org/osgeo/browser/graphics/trunk/).
> Geodesic and rhumbline layers are already using an icon with this style (the same icon, actually).
>
> Added: grass/trunk/gui/icons/grass/aspect-arrow.png
> ===================================================================
> (Binary files differ)
>
>
> Property changes on: grass/trunk/gui/icons/grass/aspect-arrow.png
> ___________________________________________________________________
> Added: svn:mime-type
>    + image/png
>
> Added: grass/trunk/gui/icons/grass/cell-cats.png
> ===================================================================
> (Binary files differ)
>
>
> Property changes on: grass/trunk/gui/icons/grass/cell-cats.png
> ___________________________________________________________________
> Added: svn:mime-type
>    + image/png
>
> Added: grass/trunk/gui/icons/grass/his.png
> ===================================================================
> (Binary files differ)
>
>
> Property changes on: grass/trunk/gui/icons/grass/his.png
> ___________________________________________________________________
> Added: svn:mime-type
>    + image/png
>
> Added: grass/trunk/gui/icons/grass/label.png
> ===================================================================
> (Binary files differ)
>
>
> Property changes on: grass/trunk/gui/icons/grass/label.png
> ___________________________________________________________________
> Added: svn:mime-type
>    + image/png
>
> Added: grass/trunk/gui/icons/grass/raster.png
> ===================================================================
> (Binary files differ)
>
>
> Property changes on: grass/trunk/gui/icons/grass/raster.png
> ___________________________________________________________________
> Added: svn:mime-type
>    + image/png
>
> Added: grass/trunk/gui/icons/grass/raster3d.png
> ===================================================================
> (Binary files differ)
>
>
> Property changes on: grass/trunk/gui/icons/grass/raster3d.png
> ___________________________________________________________________
> Added: svn:mime-type
>    + image/png
>
> Added: grass/trunk/gui/icons/grass/rgb.png
> ===================================================================
> (Binary files differ)
>
>
> Property changes on: grass/trunk/gui/icons/grass/rgb.png
> ___________________________________________________________________
> Added: svn:mime-type
>    + image/png
>
> Added: grass/trunk/gui/icons/grass/shaded-relief.png
> ===================================================================
> (Binary files differ)
>
>
> Property changes on: grass/trunk/gui/icons/grass/shaded-relief.png
> ___________________________________________________________________
> Added: svn:mime-type
>    + image/png
>
> Added: grass/trunk/gui/icons/grass/vector-chart.png
> ===================================================================
> (Binary files differ)
>
>
> Property changes on: grass/trunk/gui/icons/grass/vector-chart.png
> ___________________________________________________________________
> Added: svn:mime-type
>    + image/png
>
> Added: grass/trunk/gui/icons/grass/vector-thematic.png
> ===================================================================
> (Binary files differ)
>
>
> Property changes on: grass/trunk/gui/icons/grass/vector-thematic.png
> ___________________________________________________________________
> Added: svn:mime-type
>    + image/png
>
> Added: grass/trunk/gui/icons/grass/vector.png
> ===================================================================
> (Binary files differ)
>
>
> Property changes on: grass/trunk/gui/icons/grass/vector.png
> ___________________________________________________________________
> Added: svn:mime-type
>    + image/png
>
> Added: grass/trunk/gui/icons/grass/wms.png
> ===================================================================
> (Binary files differ)
>
>
> Property changes on: grass/trunk/gui/icons/grass/wms.png
> ___________________________________________________________________
> Added: svn:mime-type
>    + image/png
>
> Modified: grass/trunk/gui/wxpython/lmgr/layertree.py
> ===================================================================
> --- grass/trunk/gui/wxpython/lmgr/layertree.py  2014-07-19 14:56:40 UTC (rev 61279)
> +++ grass/trunk/gui/wxpython/lmgr/layertree.py  2014-07-19 16:58:44 UTC (rev 61280)
> <at> <at> -70,23 +70,23 <at> <at>
>                              label = _('Add command layer')),
>      'quit'       : MetaIcon(img = 'quit',
>                              label = _('Quit')),
> -    'layerRaster'    : MetaIcon(img = 'layer-raster-add',
> +    'layerRaster'    : MetaIcon(img = 'raster',
>                              label = _('Add raster map layer')),
> -    'layerRgb'     : MetaIcon(img = 'layer-rgb-add',
> +    'layerRgb'     : MetaIcon(img = 'rgb',
>                              label = _('Add RGB map layer')),
> -    'layerHis'     : MetaIcon(img = 'layer-his-add',
> +    'layerHis'     : MetaIcon(img = 'his',
>                                      label = _('Add HIS map layer')),
> -    'layerShaded'  : MetaIcon(img = 'layer-shaded-relief-add',
> +    'layerShaded'  : MetaIcon(img = 'shaded-relief',
>                                label = _('Add shaded relief map layer')),
> -    'layerRastarrow'  : MetaIcon(img = 'layer-aspect-arrow-add',
> +    'layerRastarrow'  : MetaIcon(img = 'aspect-arrow',
>                              label = _('Add raster flow arrows')),
> -    'layerRastnum'    : MetaIcon(img = 'layer-cell-cats-add',
> +    'layerRastnum'    : MetaIcon(img = 'cell-cats',
>                              label = _('Add raster cell numbers')),
> -    'layerVector'    : MetaIcon(img = 'layer-vector-add',
> +    'layerVector'    : MetaIcon(img = 'vector',
>                              label = _('Add vector map layer')),
> -    'layerThememap': MetaIcon(img = 'layer-vector-thematic-add',
> +    'layerThememap': MetaIcon(img = 'vector-thematic',
>                              label = _('Add thematic area (choropleth) map layer')),
> -    'layerThemechart'   : MetaIcon(img = 'layer-vector-chart-add',
> +    'layerThemechart'   : MetaIcon(img = 'vector-chart',
>                              label = _('Add thematic chart layer')),
>      'layerGrid'    : MetaIcon(img = 'layer-grid-add',
>                              label = _('Add grid layer')),
> <at> <at> -94,12 +94,12 <at> <at>
>                              label = _('Add geodesic line layer')),
>      'layerRhumb'   : MetaIcon(img = 'shortest-distance',
>                              label = _('Add rhumbline layer')),
> -    'layerLabels'  : MetaIcon(img = 'layer-label-add',
> +    'layerLabels'  : MetaIcon(img = 'label',
>                              label = _('Add labels')),
> -    'layer3d-raster'  : MetaIcon(img = 'layer-raster3d-add',
> +    'layer3d-raster'  : MetaIcon(img = 'raster3d',
>                              label = _('Add 3D raster map layer'),
>                              desc  =  _('Note that 3D raster data are rendered only in 3D view mode')),
> -    'layerWms'      :  MetaIcon(img = 'layer-wms-add',
> +    'layerWms'      :  MetaIcon(img = 'wms',
>                              label = _('Add WMS layer.')),
>      'layerOptions'  : MetaIcon(img = 'options',
>                                 label = _('Set options')),
>
> _______________________________________________
> grass-commit mailing list
> grass-commit <at> lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/grass-commit

_______________________________________________
grass-dev mailing list
grass-dev <at> lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-dev
Anna Petrášová | 19 Jul 19:04 2014
Picon

Rast3d_location2coord inconsistent behavior

Hi,

I have a question about Rast3d_location2coord [1]. It is casting the col, row, depth values to integer like this:

(int) col 

instead of using 

(int)floor(col)

as a result, col = 0.1 => col = 0 and col = -0.1 => col = 0, which doesn't seem correct to me. Any opinions?

Thanks, Anna

BTW, similar function Rast_northing_to_row from raster library returns double.


_______________________________________________
grass-dev mailing list
grass-dev <at> lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-dev
Anna Petrášová | 18 Jul 23:57 2014
Picon

Week 9: GRASS GIS 3D flowlines

Hi,

1. What did you get done this week:
I rewrote the rest of the Python implementation (added flowaccumulation and on-the-fly gradient computation). I tested it against Python implementation and when computing gradient, it still differs a little bit so I will test more. 

2. What do you plan on doing next week?
Next week I will add more code documentation and try to write some tests. Also, I would like to implement integrating flowlines in both directions.

3. Are you blocked on anything?
No.

Anna

[1] http://trac.osgeo.org/grass/wiki/GSoC/2014/ImplementationOf3DRasterFlowLine
[2] http://trac.osgeo.org/grass/browser/grass-addons/grass7/raster3d/r3.flow
_______________________________________________
grass-dev mailing list
grass-dev <at> lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-dev
Vaclav Petras | 18 Jul 17:51 2014
Picon

Weekly report 9: Testing framework for GRASS GIS

1. What did you get done this week?

I added assert methods for testing vector equality based on v.info and difference of GRASS vector ASCII files, most notably assertVectorEqualsVector() and assertVectorEqualsAscii() methods. So, comparison of two vectors is now possible. I also added assert methods for 3D rasters but my tests for some of them are failing and also some refactoring will be needed in the future.

Additionally, I included two experimental methods for vector comparison based on buffering and overlays but I'm not sure if these are more useful than the ones based on ASCII and v.info. Perhaps these could be an inspiration for comparison of vectors for report if they are not equal.

There are no special methods to test temporal datasets but comparison of key-value outputs is applicable.

By the way, there is currently 19 successfully running test files and 5 failing test files (each test file contains multiple tests). And thanks to the tests I also randomly found a bug revealed by more strict type checking (fix should be in r61272).

2. What do you plan on doing next week?

The plan was to implement the basic test results reports. I've already done part of this, so now I will improve report generation for individual test files and add different summaries to the main report page (which summarizes all test files).

The structure or the report is the same as source code (where we look for the `testsuite` directories). The difference is that  the `testsuite` directory is replaced by several directories, one for each test file. Each of these directories has its own `index.html`. The test case classes and methods probably will not have their own directories.

The `index.html` of one test file seems to be the central page of report containing basic information about individual tests (including descriptions) with links to more details such as stdout, stderr and some additional files (files created during the test). Information about tested modules will be gathered separately (using some test metadata or logging rather than using information about a directory).

The primary goal is, however, to add some parseable outputs such as key-value file with number of successful and failed tests. I'm considering also XML (XUnit XML test result format) which is understood by some applications or report tools (however, it seems that definition of this XML is not clear).

Perhaps writing some script which would gather information from different test runs would be beneficial.

3. Are you blocked on anything?

I'm not really blocked but there is few things on testing framework todo list which I might not be able to solve in the next weeks.

First, the distribution is still not completely solved (see previous week discussion). Second, the system for different locations and data requirements still waits on being tested. Third, I postponed the integration with build system and improvements in command line interface.

Also some tests, including the one for comparison of 3D raster maps, are failing for me because of the following error (same as in #2074).

ERROR: Rast3d_get_double_region: error in Rast3d_get_tile_ptr.Region
coordinates x 0 y 0 z 0 tile index 0 offset 0

Vaclav


Documentation:
http://grass.osgeo.org/grass71/manuals/libpython/gunittest_testing.html
Src:
http://trac.osgeo.org/grass/log/grass/trunk/lib/python/gunittest?rev=61266
Wiki:
http://trac.osgeo.org/grass/wiki/GSoC/2014/TestingFrameworkForGRASS#Week09

To compile the latest documentation:
  cd grass-source-code-root-dir
  make sphinxdoc
  # open file "dist.../docs/html/libpython/gunittest_testing.html"

To run all tests in all subdirectories in special location:
  python -m grass.gunittest.main gisdbasepath nc_smp_location_name nc
  # open file "testreport/index.html"

To run one test file in the current location and mapset:
  cd raster/r.gwflow/testsuite/
  python validation_7x7_grid.py
  # see the output in terminal (stdout and stderr)

Previous week discussion:
http://lists.osgeo.org/pipermail/grass-dev/2014-July/070000.html
http://osgeo-org.1560.x6.nabble.com/Weekly-report-8-Testing-framework-for-GRASS-GIS-td5150717.html
http://comments.gmane.org/gmane.comp.gis.grass.devel/59328
_______________________________________________
grass-dev mailing list
grass-dev <at> lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-dev
GRASS GIS | 18 Jul 12:11 2014

[GRASS GIS] #2373: v.generalize should create an error vector map

#2373: v.generalize should create an error vector map
-------------------------+--------------------------------------------------
 Reporter:  huhabla      |       Owner:  grass-dev <at> …              
     Type:  enhancement  |      Status:  new                      
 Priority:  minor        |   Milestone:  7.1.0                    
Component:  Vector       |     Version:  svn-trunk                
 Keywords:  generalize   |    Platform:  Linux                    
      Cpu:  x86-64       |  
-------------------------+--------------------------------------------------
 This is a feature request for v.generalize.

 We realized that it would be useful if v.generalize creates an output
 vector map that stores all lines and boundaries that were not generalized
 due to topology issues or over-simplification.

 Patch that implements this feature is attached.

--

-- 
Ticket URL: <http://trac.osgeo.org/grass/ticket/2373>
GRASS GIS <http://grass.osgeo.org>

_______________________________________________
grass-dev mailing list
grass-dev <at> lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-dev
GRASS GIS | 18 Jul 10:54 2014

[GRASS GIS] #2372: GRASS 7 on windows starts with minimized CMD window

#2372: GRASS 7 on windows starts with minimized CMD window
-------------------------+--------------------------------------------------
 Reporter:  marisn       |       Owner:  grass-dev <at> …              
     Type:  defect       |      Status:  new                      
 Priority:  blocker      |   Milestone:  7.0.0                    
Component:  Startup      |     Version:  svn-releasebranch70      
 Keywords:  wingrass     |    Platform:  Unspecified              
      Cpu:  Unspecified  |  
-------------------------+--------------------------------------------------
 This is an inverse bug of #1891

 Steps to reproduce:
  * Install Wingrass on a clean machine (without previous GRASS 7 install
 or just remove AppData/Roaming/GRASS7 folder)
  * Click on "GRASS GIS 7.0.0svn GUI" icon to launch GRASS
  * Observe how GRASS fails to start.

 Actual behaviour - GRASS starts a minimized CMD window with a welcome
 message and prompt "Press Enter to continue". Unless user notices
 minimized CMD window and makes a correct guess to restore the window to
 read any messages there, he waits forever for GRASS to start.

 Expected behaviour - GRASS starts with normal (non-minimized) CMD window
 thus allowing user to read the Welcome message and press Enter to launch
 GUI.

 I had a chance to observe how 20 persons were hit by this bug. Thus a
 claim "it doesn't affect users" is not a valid one.

 Tested on Wingrass 7.0.0 yesterdays nightly.

 Setting as a blocker for 7.0 release, as 1) it is ruining the first
 impression about GRASS GIS and 2) it is trivial to fix.

--

-- 
Ticket URL: <http://trac.osgeo.org/grass/ticket/2372>
GRASS GIS <http://grass.osgeo.org>

_______________________________________________
grass-dev mailing list
grass-dev <at> lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-dev

Gmane