[GRASS-dev] i.rectify should test for illegal file names before launching rectification

Moritz Lennert mlennert at club.worldonline.be
Wed Nov 7 04:07:45 EST 2007


On 07/11/07 01:02, Glynn Clements wrote:
> Michael Barton wrote:
> 
>>>> Sorry to be dense, but an *optioal* argument *must* be present in i.rectify,
>>>> even if it is empty? This seems like a very weird situation.
>>> It is not optional.
>>>
>>> This is not an issue in gis.m from where you cannot call i.rectify
>>> anymore (you have to go through the georectifying tool) .You can try it
>>> by typing i.rectify at the command line. In the tcltk window that pops
>>> up, just type any bogus values into all fields except for extension. If
>>> you click on run, you will get the error message:
>>>
>>> ERROR: Required parameter <extension> not set:
>>>      (Output file extension (inputfile(s) + extension)).
>>>
>>> But in my case I don't want an extension, or, said differently, I want
>>> the extension to be empty. At the command line, I can just type
>>> 'extension=', but there is no way I can give an 'empty' value to the
>>> extension parameter in the tcltk gui.
>>>
>>>> To do it in TclTk, I'd do it one of two ways, depending on which execution
>>>> procedure you are using.
>>>>
>>>> You could just put the whole command in quotes as a string.
>>>>
>>>> set cmd "i.rectify ... extension="
>>>>
>>>> [parse and run] cmd
>>>>
>>>> OR
>>>>
>>>> You could put the command in a list and parse it that way.
>>>>
>>>> set cmdlist [list "i.rectify" "arg1" "arg2" ... "extension="]
>>>>
>>>> [parse and run] cmdlist
>>> So this means we have to change g.parser as Glynn seems to suggest,
>>> especially if this concerns other modules as well.
>> Is this an error of requiring extension to be set? If so, this can be
>> changed in the C code of the module. This seems like the simplest solution.
> 
> No, the problem is gis.m's inability to pass the empty string as an
> option's value. If you leave the text field blank, the option simply
> doesn't get passed.
> 

To be totally fair it isn't gis.m's inability, but the inability of the 
automatically generated tcltk command gui...gis.m's menus actually do 
not include an entry for i.rectify as it is embedded in the georectifier 
(which always sets an extension).

Moritz




More information about the grass-dev mailing list