Thanks everyone for this very interesting discussion. I think I will
have a look to the swig interface and the wxpython solutions. <br>
I already looked to the &quot;earthquake php&quot; code, but I'm not sure it
could be an &quot;operative&quot; solution, it's a nice thing but it becomes a
heavy workload for the system having to run php system calls to bash
scripting and then to R... and come back to php? It sounds that
efficiency and memory issues would be the main problems, dont'you think?<br>
As a result:<br>
&nbsp;- use R from shell scripitng<br>
&nbsp;- call, eventually, external programs using R system() function<br>
&nbsp;- make gis analysis through shell scripting<br>
&nbsp;- create a GUI with these solutions to be studied: the web way:
pywps (HOPE MARKUS CAN GIVE ME SOME NEWS about it, I can't find the
page anymore!!!), java(swig), php; wxpythn.<br>
I think the web solutions are the only one suitable to run my tool from
any platform... that's why I was trying to avoid using scripting!!!<br>
Anyway, Roger, I will keep into account your tips about the
difficulties to automate R; I will find a way to break the whole
elaboration into multiple small operations to keep control over each of
theme.<br>
Giovanni<br>
<br>
<br><div><span class="gmail_quote">2006/10/24, Roger Bivand &lt;<a href="mailto:Roger.Bivand@nhh.no">Roger.Bivand@nhh.no</a>&gt;:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
On Tue, 24 Oct 2006, Hamish wrote:<br><br>&gt; G. Allegri wrote:<br>&gt; &gt; I know it sounds quite strange what I'm trying to do, and maybe it<br>&gt; &gt; isn't the best way to do it.<br>&gt; &gt; What I meant to do is an interactive (through a GUI interface to
<br>&gt; &gt; develop) tool to elaborate hydrogeochemical datas about acquifer<br>&gt; &gt; pollution defense. It should be used by an end-user as a Decision<br>&gt; &gt; Support System tool. It will use raster and vector input data to be
<br>&gt; &gt; treated with mapalgebra and geostatisitcal analysis. The worst problem<br>&gt; &gt; is that it should be, somehow, platform independent.<br>&gt; &gt; I'm not a professional programmer, I'm a geologist, and surely it
<br>&gt; &gt; would be easiar to work with scripting then C coding, but it gets<br>&gt; &gt; harder to develop the &quot;wizard&quot; interface...<br>&gt; &gt; In regard using R in an interactive way: I would like to &quot;grep&quot; simply
<br>&gt; &gt; the output (as standard output or ascii file) and&nbsp;&nbsp;then use it for my<br>&gt; &gt; purposes.<br>&gt; &gt; Could you suggest me a way to implement this &quot;stange&quot; architecture?<br>&gt; &gt; Giovanni<br>
&gt; &gt;<br>&gt; &gt; P.S.: I'm considering the web interface way too...<br>&gt;<br>&gt;<br>&gt; just a hint about what the next multi-platform GUI for GRASS will use.<br>&gt;<br>&gt; Currently grass uses tcl/tk as a multi-platform GUI frontend.
<br>&gt;<br>&gt; You can use the g.parser module to create a (static) GUI frontend to a<br>&gt; shell script. (see any of the grass 6 scripts and g.parser help page for<br>&gt; an example)<br>&gt;<br>&gt; After some deliberation the next GRASS GUI will be based on WxPython, so
<br>&gt; that may be an obvious choice for you. Some initial infrastructure &amp;<br>&gt; examples have been added to the GRASS 6.3 source code, see<br>&gt; gui/wxpython/.<br>&gt;<br>&gt; Also, perhaps the new SWIG interface is useful for you, that's in swig/
<br>&gt; in the grass source code. Right now it has some perl and python<br>&gt; bindings, but that can be extended to Java, etc as well. Roger: could<br>&gt; this be a better way to code the GRASS&lt;-&gt;R interface? (or is it fine
<br>&gt; as-is?)<br><br><br>The interface is &quot;R-in-front-of-GRASS&quot;, using whatever UI R is using, with<br>GRASS just being the database. R cannot assume the presence of any of<br>these other components, but more complicated setups can be built with
<br>&quot;R-in-the-middle&quot; or &quot;R-as-a-backend-compute-server&quot;, such as R embedded<br>in PostgreSQL as a PL (which would be &quot;GRASS-in-front-of-PostgreSQL&quot;<br>&quot;-in-front-of-R&quot;). But prototyping any actual data analysis in that
<br>setting is bluesky^2, ie. not having the data analysis tool in front runs<br>the strong risk of garbage in, garbage out, unless there is very detailed<br>control of data entering the system and analyses are kept really simple.
<br><br>Just things like missing values can trip things up so easily, that<br>anything beyond a shell script running R as a script engine is foolhardy.<br>Just in the last month there have been several reports of the GRASS wiki
<br>v.krige failing (shell script of R running gstat on spgrass6), all caused<br>by data points at the same locations (which lead to singularity within<br>gstat).<br><br>Since the number of possible error conditions is largely unknown, and
<br>grows in proportion with the level of complication of the analysis (and<br>one does use data analysis tools mainly to do more complicated things), I<br>really don't think putting R behind a GIS GUI is a sensible step unless
<br>there is a lot of coding and maintenance support (UK vet services were<br>doing something like this for point pattern analysis, but I think ran into<br>software roll-out issues, needing local ArcGIS/R/splancs/glue, which
<br>became too heavy. A client-server setup would also have been better there,<br>I believe.<br><br>By the way, I don't use GRASS in anything other than -text anyway, except<br>for digitising and visualisation, though this is a minority view. Most of
<br>the interfacing of R and SWIG is dormant. Rpy does run, as now does JRI<br>and rJava (but not SJava), Perl get used on development platforms but not<br>by regular users. For people needing GUI/GRASS-in-fornt-of-R, I guess Rpy
<br>provides for using R from Python, but how this would handle larger data<br>volumes is open.<br><br>My personal preference is arT using Terralib, or myR (same place). My<br>guess is that many GRASS modules could be rewritten to use Terralib
<br>instead of libgis etc., and that these interfaces are cleaner, but this is<br>aesthetic, I haven't used it in earnest.<br><br>Roger<br><br>&gt;<br>&gt; I don't know enough about either to tell you what's the best or easiest
<br>&gt; path (or not), but fyi those are two available methods under active<br>&gt; development (better support) and perhaps warrant some investigation.<br>&gt; Note it's still early days for both SWIG and WxPython in GRASS.
<br>&gt;<br>&gt;<br>&gt; &gt; Look at this <a href="http://les-ejk.cz/?cat=pywps">http://les-ejk.cz/?cat=pywps</a><br>&gt;<br>&gt; another to check out is Markus's PHP earthquake map:<br>&gt;&nbsp;&nbsp; <a href="http://grass.itc.it/spearfish/php_grass_earthquakes.php">
http://grass.itc.it/spearfish/php_grass_earthquakes.php</a><br>&gt;<br>&gt;<br>&gt; good luck - it sounds like a neat project and I think all the<br>&gt; ingredients to the recipe are here, just need the right glue.<br>&gt;
<br>&gt;<br>&gt; Hamish<br>&gt;<br><br>--<br>Roger Bivand<br>Economic Geography Section, Department of Economics, Norwegian School of<br>Economics and Business Administration, Helleveien 30, N-5045 Bergen,<br>Norway. voice: +47 55 95 93 55; fax +47 55 95 95 43
<br>e-mail: <a href="mailto:Roger.Bivand@nhh.no">Roger.Bivand@nhh.no</a><br><br></blockquote></div><br>