[GRASS-dev] porting r.in.wms to python

Hamish hamish_b at yahoo.com
Sun Oct 5 22:16:21 EDT 2008


>>> before anyone spends any time porting r.in.wms/r.tileset to python,
Glynn wrote:
> > I was planning on leaving those until last ;)
> 
> Well, I'm now planning on just leaving them, period ;)
> 
> Here's the current status on conversion of scripts to
> Python:
> 
> The following scripts are disabled, and haven't been converted:
> 
> 	d.out.gpsdrive   (d.mon)

(me)
like the very useful d.out.file module, it dumps current (composed) map
display to the PNG driver via d.save. I suppose replacing this will
be a clone/modification of how d.out.file's functionality has been
replicated.

> 	d.rast.leg       (d.frame)

(any thoughts Markus?)

perhaps replaced by some wxGUI "load cartographic template" tool?
(users could contribute their own etc..)

> 	d.vect.thematic  (d.mon)

(somewhat replaced d.thematic.area,v.class?  any thoughts Moritz/Michael?)

> 	i.spectral       (d.mon, d.where)

It would be very easy to add a coord=x,y[,x2,y2,...] option to feed
r.what instead of using d.where. The d.mon check is just to ensure
that d.where will work.
More work would be to replace gnuplot with d.graph or whatever, like
is done for d.polar.

> 	r.mapcalculator  (redundant)
> 	r3.mapcalculator (redundant)

and probably belonged in etc/gui/scripts/ all along.
 
> We need to decide whether they are to be fixed or removed.
 

> These:
> 	r.in.wms/r.in.wms
> 	r.tileset/r.tileset

I think it is ok for the replacement version to depend on GDAL > 1.5.0.
A first step will be adding XML+GDAL option to the bash/sh version
for testing of that method.

> 	v.in.gpsbabel/v.in.gpsbabel
> 	v.in.garmin/v.in.garmin

Certainly v.in.gpsbabel should survive in some form. v.in.garmin is
useful as the gpsbabel garmin filter does not pass through all fields.

the XML stuff in v.in.gpsbabel is in desperate need of a python
replacement, otherwise it shouldn't be /too/ different from v.in.mapgen.


> are too complex to replace using "rote" conversion (i.e. simply
> replacing each chunk of code with equivalent Python code).

> The above scripts really need to be rewritten by someone
> who understands the overall purpose of the script.

For v.in.gps I guess that means me, but my python+xml is rather weak.


For a Python version r.in.wms, I defer the larger project to someone
else, but can try to add GDAL support to the existing sh/bash version
to demonstrate/verify the method.


[...]
etc/gui/scripts/d.colors.sh
etc/gui/scripts/d.path.sh
etc/gui/scripts/r.colors.rules
etc/gui/scripts/r.reclass.file
etc/gui/scripts/r.reclass.rules
etc/gui/scripts/r.recode.file
etc/gui/scripts/r.recode.rules

these are all there as wrapper code between the GUI and command line
modules, usually WRT piping info from stdin. All should be replaced by
integrated wxGUI wizards not simply python scripts AFAICT.


etc/gui/scripts/r.support.sh  was partially needed because
1) non-interactive version did not in the past support all interactive
functionality, and
2) interactive version weirdly exits prematurely when called directly
from Tcl/Tk.


Hamish



      



More information about the grass-dev mailing list