| 1 | = v.krige development = |
| 2 | |
| 3 | v.krige module has been developed in 2009 by Anne Ghisla during Google Summer of Code, mentored by Martin Landa. |
| 4 | |
| 5 | See http://grasswiki.osgeo.org/wiki/V.krige_GSoC_2009 for information on installation and examples. |
| 6 | |
| 7 | == Bulletin Board == |
| 8 | |
| 9 | * '''TODOs''' |
| 10 | * [permanent todo] Cleanup code! Refactoring brings refactoring. |
| 11 | * wxGUI: Split widget creation and layout - makes more readable code |
| 12 | * Solve '''double parsing issue from RunCmd.''' This leads to unnecessary double dependency check. |
| 13 | * Continue integrating '''gstat functions''' - universal kriging first. |
| 14 | * Add '''region resolution parameter in interface''', showing the current value and allowing the user to modify it before kriging. High resolution slows down computation and give better results, but the user should have a clear feedback (I have been surprised by long runs more than once, because I was not aware of resolution). |
| 15 | * wxGUI: GetVector() should check for name validity, if a string is inserted? |
| 16 | |
| 17 | * '''IDEAS TO DISCUSS''' |
| 18 | * '''Splash screen at module load''' will be implemented, but activated only if maps are more than a threshold number [Markus Neteler's suggestion] |
| 19 | * Create a '''package''' to delegate dependencies check? (Stefan Krüger's suggestion) |
| 20 | |
| 21 | * '''BROKEN WINDOWS (from Martin Fowler's great book [0]) ''' |
| 22 | * Imperfect logging - relies on RunCmd... |
| 23 | * The RBookPage::refresh() function has an endless cycle that keeps R graphics window responsive, even when that window has been closed by the user. |
| 24 | * spgrass6::readVECT6() and mapset name - see [http://lists.osgeo.org/pipermail/grass-stats/2009-August/001126.html this thread]. |
| 25 | |
| 26 | * '''FUTURE PLANS''' |
| 27 | * Rewrite v.krige in order to remove R dependency. It is not nice to add another program as dependency of a core module, a library is acceptable. Possible candidates: |
| 28 | * '''gstat''' - Pro: it has native GRASS binding. Con: it is not developed as standalone program since 2003, in favour of R package gstat. |
| 29 | * '''HPGL''' http://hpgl.aoizora.org/ - Python/C++ library with Python API. Pro: Very rich set of functions and parallelisation. Con: Not supported on Mac |
| 30 | |
| 31 | |
| 32 | == Weekly Reports, from SoC mailing list [4] == |
| 33 | |
| 34 | '''Report #1, 29 May''' |
| 35 | |
| 36 | * Done: I dedicated this week to documentation and discussion with users and developers. |
| 37 | ** Documentation: I'm reading "An introduction to Applied Geostatistics" [1], as I need to understand the theory behind kriging functions provided by R. On wxPython side, wxPython wiki is the main source of information, together with the code of GRASS wxPython interface. |
| 38 | ** Community discussion: Feedback on interface design and R has been collected on various mailing lists. Also, a group of Portuguese ArcGIS users is interested in giving advice and test the new module. |
| 39 | |
| 40 | * Planned for next week |
| 41 | I plan to define which functions (and consequently which R packages) are to be included into the module. I plan to first include package automap (a wrapper for gstat), then gstat advanced functions, then geoR (an "ecological vicariant" of gstat), all alvailable on CRAN [5]. This will allow R users to keep using their preferred functions, as kriging results are implementation-dependent. |
| 42 | Then I'll work on wxPython interface and get a draft as soon as possible. The interfaces that I use as model are ArcGIS' kriging module and Isatis. I won't replicate their structure, rather see what are the provided features and create v.autokrige interface following Humane Interface guidelines. |
| 43 | |
| 44 | * Bottleneck(s) |
| 45 | I'm experiencing some difficulties, mainly with wxPython, as I never used it before, and also with kriging, for the same reason :) but I'm not worried nor blocked. Last year GSoC project was a bet and I succeeded, this year it's even harder but I can rely on some more experience and, as always, on mentor and community support. |
| 46 | |
| 47 | '''Report #2, 5 June''' |
| 48 | |
| 49 | * Done |
| 50 | ** Ended "An Introduction to Applied Geostatistics", great source of information of what the module is supposed to do. Now I can be both developer and user, not discarding any of the hints of other users. |
| 51 | ** Some progress on the interface: I'm getting used of wxWidgets, even if the lack of a graphical designer slows down my work. wxDesigner seems good, but I think it is also good for me to learn the meaning of each line of code. The interface is quite ready for automap and GRASS integration. |
| 52 | |
| 53 | * Planned for next week |
| 54 | End of interface essential features and integration of automap most automated functions - ideally, the user will pick up the point layer containing data and press OK. |
| 55 | |
| 56 | * Bottleneck(s) |
| 57 | The only bottleneck is wxWidgets handling, but not so much as one week ago. |
| 58 | |
| 59 | '''Report #2.5, 11 June''' |
| 60 | |
| 61 | First of all, the interface is almost finished.. |
| 62 | The layout includes a notebook with a page for each R package (automap, gstat and geoR), with the available options. Another layout could be a chiocebox wht the three packages on the top of Kriging section, that redraws the section accourding to the user's choice. |
| 63 | Let me know which one do you prefer, feel free also to suggest something new. |
| 64 | |
| 65 | The R-GRASS integration is on its way: autofitting the variogram on a map obtained from a DEM sample works in the proof of concept. rpy2 is extremely helpful and does not require much more code than the original R code. More to come in the next days. |
| 66 | |
| 67 | The idea for variogram fitting is to plot the variogram in a new frame and add some controls like sliders and/or text boxes to fill up with |
| 68 | nugget, sill and range values. This will involve Python graphics, not R, as the former is more flexible. |
| 69 | |
| 70 | '''Report #3, 12 June''' |
| 71 | |
| 72 | this weekly report will be very short, as yesterday I sent this email (Report 2.5, see above) and made little progress. |
| 73 | |
| 74 | I'm having some problems in using autoKrige() function work, AFAIK because of projection information handling. |
| 75 | |
| 76 | '''Report #4, 19 June''' |
| 77 | |
| 78 | this week I made steady progress on the module. |
| 79 | What I've done: |
| 80 | * renamed the module v.krige, as its features will go beyond automatic kriging. |
| 81 | * addition of choicebox with only numerical columns, as interpolation will be based on such variables |
| 82 | * refactoring on interface population - more to come |
| 83 | * started documentation page |
| 84 | |
| 85 | Next week I plan to create the splashscreen during dependencies check and data load, and examine how to integrate gstat functions. |
| 86 | |
| 87 | '''Report #5, 26 June (at [http://wiki.osgeo.org/wiki/OSGeo_Hacking_Event_2009 OSGeo Bolsena Hacking Event])''' |
| 88 | |
| 89 | just few minutes ago I succeded in completing the kriging procedure with gstat functions. It runs with a proof-of-concept dataset based on |
| 90 | spearfish data. Martin helped me a lot in getting the standard wxGUI comboboxes to run properly with filters. |
| 91 | |
| 92 | Next week I plan to adapt the interface to each R package's available options and consider how to solve lag issues in populating interface. |
| 93 | |
| 94 | The blocking issue about autoKrige() and projections is no more valid as I create the grid myself based on GRASS region. |
| 95 | |
| 96 | '''Report #6, 3 July''' |
| 97 | |
| 98 | this week I worked on removing parameters hardwired in the code, binding them to the interface instead. |
| 99 | Therefore, now it is possible use all widgets in gstat and automap pages, i.e. pick up the model from a list, set sill, nugget and range; |
| 100 | set the output raster map name and eventually overwrite it. |
| 101 | I'm going to implement CLI in these next days, it will very likely need to reorganise the code and clearly split interface from model. |
| 102 | |
| 103 | Blocking issues - none. |
| 104 | |
| 105 | '''Report #7, midterm, 10 July''' |
| 106 | |
| 107 | this week has been full of improvements: |
| 108 | * CLI with optional arguments is up and running |
| 109 | * interface creation is no more delayed by vector map filtering |
| 110 | * dependencies are checked all at the beginning - no risk of mid-process crashes if something is missing |
| 111 | * automap page merged with gstat: they share the same algorithms |
| 112 | * geoR page hidden, no implementation yet |
| 113 | * deep refactoring of the rpy code, moved into a separate controller class |
| 114 | * interface fills up all options except input data map - minimum interaction required (2 clicks) |
| 115 | |
| 116 | next week I plan to implement the splashscreen and add further functionalities, hopefully different kriging techniques. |
| 117 | |
| 118 | Blocking issues - none. |
| 119 | |
| 120 | '''Report #8, 17 July''' |
| 121 | |
| 122 | this week I added Command output tab and the option for block kriging, and updated documentation with more precise information on dependencies. |
| 123 | I'll add splashscreen only as dependency check and command output will be fixed: next week I plan to work on these latter issues. |
| 124 | |
| 125 | Nothing in particular is blocking progress, just some hardest stone sometimes. |
| 126 | |
| 127 | '''Report #9, 24 July''' |
| 128 | |
| 129 | this week I didn't work on the project because I attended last university course (botanical survey at Stelvio pass) and came back yesterday night. |
| 130 | |
| 131 | Next week I plan to solve g.parser issue about double dependency check and the issue about sill, nugget and value parameters, that are optional |
| 132 | for R. A general cleanup of the code is also welcome... |
| 133 | |
| 134 | No blocking issues atm. |
| 135 | |
| 136 | '''Report #10, 31 July''' |
| 137 | |
| 138 | good news from v.krige: |
| 139 | * fixed optional parameters also in interface - activated by a checkbox, otherwise R's NA value is correctly set |
| 140 | * interactive variogram fit is on its way - stay tuned! |
| 141 | |
| 142 | Next week I plan to set up interactive variogram using matplotlib functions and get the stabler code possible for feature freeze. |
| 143 | |
| 144 | |
| 145 | '''Report #11, 7 August''' |
| 146 | |
| 147 | this week I worked on error handling by GUI, adding controls on input data and parameters and hiding Run and Plot buttons unless all options are suitable. |
| 148 | Variogram plotting is on its way - I discarded matplotlib to avoid further dependencies, in favour of wx.lib.plot. |
| 149 | |
| 150 | |
| 151 | '''Report #12, 14 August''' |
| 152 | |
| 153 | this is last SoC report - bringing variogram plotting into v.krige! After a long time searching for the lightest and cleanest implementation, R plotting raised as the best solution. On user demand, a R graphics window plots variogram and refreshes it, without interfering with wxGUI. |
| 154 | Documentation includes a full example using Spearfish dataset and all informations about dependencies. |
| 155 | |
| 156 | Many thanks to all who have helped me writing v.krige: GRASS and R developers, OSGeo SoC crew, wise friends, all testers. |
| 157 | I hope this module will attract people towards GRASS and R, and provide a valid alternative to closed-source kriging tools. |