GRASS GSoC 2012 WxGUI front end for vector analysis modules: Difference between revisions

From GRASS-Wiki
Jump to navigation Jump to search
(+ link to repository)
 
(32 intermediate revisions by 4 users not shown)
Line 10: Line 10:
|-
|-
| Title: || '''WxGUI front end for vector network analysis modules'''
| Title: || '''WxGUI front end for vector network analysis modules'''
|-
| Repository: || sandbox, browse at: [https://trac.osgeo.org/grass/browser/sandbox/turek/scatter_plot scatter_plot]
|-
|-
|}
|}
Line 15: Line 17:
;Abstract
;Abstract


GRASS GIS provides various modules for vector network analysis. It is difficult to use these powerful modules for beginners in GRASS because these modules can be used only in command line. Main goal of the project is to make user-friendly WxGUi front end for vector network analyses. Additional goal is to improve functionality of Attribute Table Manager.
GRASS GIS provides various modules for vector network analysis. It is difficult to use these powerful modules for beginners in GRASS because these modules can be used only in command line. Main goal of the project is to make user-friendly WxGUI front end for vector network analyses. Additional goal is to improve functionality of Attribute Table Manager.


__TOC__
__TOC__
Line 43: Line 45:
{| {{table}}
{| {{table}}
|-
|-
!Period !! Task !! Status / Notes
!Period !! Task !! Status !! Notes
|-
|-
|April 23 - May 20 || Bonding period || {{done}}
|April 23 - May 20 || Bonding period || {{done}} ||
|-
|-
|May 21 || design of front end, studying code || {{done}}
|May 21 || design of front end, studying code || {{done}} ||
|-  
|-  
|May 28 || design of front end, studying code || {{done}}
|May 28 || design of front end, studying code || {{done}} ||
|-
|-
|June 4 || dialog for front end || {{done}}
|June 4 || dialog for front end || {{done}} ||
|-
|-
|June 11 || v.net.path implementation to front end, dialog || point list - map win connection
|June 11 || v.net.path implementation to front end, dialog || {{done}} || points list - map win connection, ({{done}} in July 2 - 9 week)
|-
|-
|June 18 ||v.net.path + other v.net* modules implementation to front end ||
|June 18 ||v.net.path + other v.net.* modules implementation to front end || {{done}} || improved map win API for mouse event handlers and for drawing
|-
|-
|June 25 || other v.net* modules implementation to front end ||
|June 25 || other v.net.* modules implementation to front end || {{done}} || the map win API - testing, commit, ({{done}} in July 9 - 16 week)
|-
|-
|July 2 || adaptation of front end behavior for different v.net modules ||
|July 2 || adaptation of front end behavior for different v.net modules || {{done}} || v.net.path implemented into front end
|-
|-
|July 9 || continue with adaptation, bug fixing ||
|July 9 || continue with adaptation, bug fixing || {{done}} || other v.net.* modules implementation
|-
|-
|'''July 13''' || Mid-term evaluations deadline ||  
|'''July 13''' || Mid-term evaluations deadline || {{done}} || passed
|-
|-
|July 16 || undo/redo functionality ||
|July 16 || undo/redo functionality || {{done}} ||  adaptation, bugs fixing
|-
|-
|July 23 || undo/redo functionality ||
|July 23 || undo/redo functionality || {{done}} || + snapping to nodes
|-
|-
|July 30 ||  Attribute Table Manager ||
|July 30 ||  Attribute Table Manager (ATM), refactoring || {{done}} || refactoring
|-
|-
|August 6 || Attribute Table Manager ||
|August 6 || ATM, Field calculator || {{done}} || refactoring, field calculator
|-
|-
|August 13 ||  Attribute Table Manager ||
|August 13 ||  ATM, wx.vnet integration || {{done}} || integration
|-
|-
|August 20 ||  testing, documentation ||
|August 20 ||  testing, documentation || ||
|-
|-
|'''August 24''' || Final evaluation ||
|'''August 24''' || Final evaluation || ||
|}
|}


Line 94: Line 96:
2. Go to Map Display Window and choose 'Vector network analysis' from 'Analyze' menu
2. Go to Map Display Window and choose 'Vector network analysis' from 'Analyze' menu


[[Image:wxgui-vnet-testing.png|center|640px|Launch 'Vector network analysis' tool from Map Display Window toolbar]]
[[Image:wxgui-vnet-testing.png|center|800px|thumb|Launch 'Vector network analysis' tool from Map Display Window toolbar]]


== Roadmap ==
== Roadmap ==
Line 150: Line 152:
* GCP rewritten to use this registration for drawing ground control points ({{rev|52257}}).
* GCP rewritten to use this registration for drawing ground control points ({{rev|52257}}).


=== Week 7 (June 2) ===
=== Week 7 (July 2) ===
* Integrated {{cmd|version=70|v.net.path}} module into dialog  ({{rev|52330}}):
* Integrated {{cmd|version=70|v.net.path}} module into dialog  ({{rev|52330}}):


[[Image:Vnet dlg shortest path.png|500px|center|thumb|Dialog - {{cmd|version=70|v.net.path}} analysis (2012-7-06)]]
[[Image:Vnet dlg shortest path.png|500px|center|thumb|Dialog - {{cmd|version=70|v.net.path}} analysis (2012-7-06)]]
=== Week 8 (July 9) ===
* Integrated modules:
** {{cmd|version=70|v.net.alloc}}
** {{cmd|version=70|v.net.flow}}
** {{cmd|version=70|v.net.iso}}
** {{cmd|version=70|v.net.distance}}
** {{cmd|version=70|v.net.salesman}}
* Added output console
* Analysis is run in other thread than GUI
[[Image:V_net_dlg_alloc.png|500px|center|thumb|Dialog - {{cmd|version=70|v.net.alloc}} analysis (2012-7-13)]]
=== Week 9 (July 16) ===
* Added new options into settings dialog
* Parameters tab:
** Better interaction of selects
** Checks for incorrect values
* Protection from overwriting of vector maps, which have same name as temporary vector maps created during analysis
* Checks if temporary vector maps were not changed outside
* Bugs fixing
* Code reorganization
=== Week 10 (July 23) ===
* Implemented snapping to nodes feature
* Implemented undo/redo functionality, which enables to browse previous analysis results
=== Week 11 (July 30) ===
* Studied code of [http://grass.osgeo.org/grass70/manuals/html70_user/wxGUI.Attribute_Table_Manager.html Attribute Table Manager]
* Refactoring of Attribute Table Manager
* Improvements of snapping and undo/redo functionality
=== Week 12 (August 6) ===
* Refactoring of Attribute Table Manager - {{rev|52641}}
* Implementation of field calculator
=== Week 13 (August 13) ===
* Added attribute table browser of input layers  and results of analysis
* Bugs fixing
* Added statusbar
[[Image:Vnet_attribute_table_browser_input.png|400px|center|thumb|Attribute table browser of input layers(2012-7-13)]]


== Weekly Reports ==
== Weekly Reports ==
Line 162: Line 215:
* [http://lists.osgeo.org/pipermail/soc/2012-June/001825.html #4 (2012/06/15)]
* [http://lists.osgeo.org/pipermail/soc/2012-June/001825.html #4 (2012/06/15)]
* [http://lists.osgeo.org/pipermail/soc/2012-June/001857.html #5 (2012/06/22)]
* [http://lists.osgeo.org/pipermail/soc/2012-June/001857.html #5 (2012/06/22)]
* [http://lists.osgeo.org/pipermail/soc/2012-July/001886.html #6 (2012/07/01)]
* [http://lists.osgeo.org/pipermail/soc/2012-July/001886.html #6 (2012/07/1)]
* [http://lists.osgeo.org/pipermail/soc/2012-July/001895.html #7 (2012/07/06)]
* [http://lists.osgeo.org/pipermail/soc/2012-July/001895.html #7 (2012/07/6)]
* [http://lists.osgeo.org/pipermail/soc/2012-July/001915.html #8 (2012/07/13)]
* [http://lists.osgeo.org/pipermail/soc/2012-July/001944.html #9 (2012/07/21)]
* [http://lists.osgeo.org/pipermail/soc/2012-July/001965.html #10 (2012/07/28)]
* [http://lists.osgeo.org/pipermail/soc/2012-August/001990.html #11 (2012/08/4)]
* [http://lists.osgeo.org/pipermail/soc/2012-August/002011.html #12 (2012/08/11)]
* [http://lists.osgeo.org/pipermail/soc/2012-August/002026.html #13 (2012/08/17)]

Latest revision as of 01:12, 27 July 2013

(See also other GRASS GSoC 2012 projects)

Student Name: Stepan Turek, Czech University in Prague
Organization: OSGeo - Open Source Geospatial Foundation
Mentor Name: Martin Landa Backup mentor: Markus Metz
Title: WxGUI front end for vector network analysis modules
Repository: sandbox, browse at: scatter_plot
Abstract

GRASS GIS provides various modules for vector network analysis. It is difficult to use these powerful modules for beginners in GRASS because these modules can be used only in command line. Main goal of the project is to make user-friendly WxGUI front end for vector network analyses. Additional goal is to improve functionality of Attribute Table Manager.

Application

Introduction

GRASS GIS provides various modules for vector network analysis. It is difficult to use these powerful modules for beginners in GRASS because these modules can be used only in command line. Main goal of the project is to make user-friendly WxGUI front end for vector network analysis tools. Additional goal is to improve functionality of Attribute Table Manager.

Background

Purpose of network analysis is finding optimal solution of the problem on graph. All GRASS vector network analysis modules have prefix v.net plus interactive module d.path. The modules use Directed Graph Library as engine for network analysis. Currently, module d.path does not work in GRASS 7 because of X monitors dependency which GRASS 7 does not support.

The idea

Vector network analysis WxGUI front end will use v.net.* + d.path modules for computations.

The WxGUI front end will work that way: User will just choose type of analysis from menu, set parameters for analysis (vector map, layers, costs...), insert some points into map by mouse or by their coordinates, then will run the analysis and see the result. Then user will be able to easily change configuration of points and run analysis again. Results of analyses will be implicitly saved as temporary maps and user will have option to save it permanently. There will be undo redo features for history browsing therefore maps created few steps in history will be temporary saved. Before running of analysis points will be inserted as nodes into vector layer, because v.net module will be automatically called.

Second part of the project will deal with improving of Attribute Table Manager, because important part of vector network analysis includes work with the attribute table. Important feature related to vector network analysis, which Attribute Table Manager misses, is a field calculator. The field calculator would be very useful for calculating cost values for network segments. It will be front end of v.db.update module. During development I will make effort to re-use already written code in GRASS or modify the code in order to make it re-usable. Interactive input of points is already implemented in WxGUI, it will be used for vector analysis front end.

Project plan

Period Task Status Notes
April 23 - May 20 Bonding period
May 21 design of front end, studying code
May 28 design of front end, studying code
June 4 dialog for front end
June 11 v.net.path implementation to front end, dialog points list - map win connection, ( in July 2 - 9 week)
June 18 v.net.path + other v.net.* modules implementation to front end improved map win API for mouse event handlers and for drawing
June 25 other v.net.* modules implementation to front end the map win API - testing, commit, ( in July 9 - 16 week)
July 2 adaptation of front end behavior for different v.net modules v.net.path implemented into front end
July 9 continue with adaptation, bug fixing other v.net.* modules implementation
July 13 Mid-term evaluations deadline passed
July 16 undo/redo functionality adaptation, bugs fixing
July 23 undo/redo functionality + snapping to nodes
July 30 Attribute Table Manager (ATM), refactoring refactoring
August 6 ATM, Field calculator refactoring, field calculator
August 13 ATM, wx.vnet integration integration
August 20 testing, documentation
August 24 Final evaluation

Testing

Code is available from GRASS AddOns SVN repository

svn co http://svn.osgeo.org/grass/grass-addons/grass7/gui/wxpython/wx.vnet
How to install & test

1. Install wx.vnet extension via g.extension

g.extension -s extension=wx.vnet

2. Go to Map Display Window and choose 'Vector network analysis' from 'Analyze' menu

Launch 'Vector network analysis' tool from Map Display Window toolbar

Roadmap

Week 1 (May 21)

Week 2 (May 28)

  • implemented interactive inserting of coordinates from map window to module parameter field

Week 3 (June 4)

  • created first version of dialog for vector network analysis
  • separation of points list code from GCP Manager to new class which is shared with the dialog and the manager
Dialog - Points list tab (2012-6-08)
Dialog - Settings tab (2012-6-08)

Week 4 (June 11)

  • connected points list with map window
Points from list showed in map window (2012-6-15)

Week 5 (June 18)

  • worked on improving registration of event handlers to MapWindow (connection with toolbars)
  • worked on registration and drawing of graphics in MapWindow
  • GCP rewritten to use the registration of graphics

Week 6 (June 25)

  • most of time I tested and tuned the changes in trunk

Committed changes:

  • Improved event handlers registration API (r52255):
    • possible to unregister concrete handler from event (with help of Vaclav Petras and Anna Kratochvilova)
    • imroved toggling and untoggling buttons in map window toolbars
    • the toolbars reacts on registration and unregistration
    • implemented button for interactive inserting of coordinates
Button for interactive inserting of coordinates from map window. (2012-7-01)
  • Implemented API for drawing lines and points in map window (r52256).
  • GCP rewritten to use this registration for drawing ground control points (r52257).

Week 7 (July 2)

Dialog - v.net.path analysis (2012-7-06)


Week 8 (July 9)

  • Added output console
  • Analysis is run in other thread than GUI
Dialog - v.net.alloc analysis (2012-7-13)

Week 9 (July 16)

  • Added new options into settings dialog
  • Parameters tab:
    • Better interaction of selects
    • Checks for incorrect values
  • Protection from overwriting of vector maps, which have same name as temporary vector maps created during analysis
  • Checks if temporary vector maps were not changed outside
  • Bugs fixing
  • Code reorganization

Week 10 (July 23)

  • Implemented snapping to nodes feature
  • Implemented undo/redo functionality, which enables to browse previous analysis results

Week 11 (July 30)

  • Studied code of Attribute Table Manager
  • Refactoring of Attribute Table Manager
  • Improvements of snapping and undo/redo functionality

Week 12 (August 6)

  • Refactoring of Attribute Table Manager - r52641
  • Implementation of field calculator

Week 13 (August 13)

  • Added attribute table browser of input layers and results of analysis
  • Bugs fixing
  • Added statusbar
Attribute table browser of input layers(2012-7-13)


Weekly Reports