[GRASS-dev] v.edit map

Hi,

should be 'map' in v.edit (for GRASS7) replaced by 'input/output'?
When options are specified incorrectly or the module crashes, vector
is not backuped, data are lost. The input/output paramaters would be
probably better for this module.

What do you think?

Martin

--
Martin Landa <landa.martin gmail.com> * http://gama.fsv.cvut.cz/~landa

Martin Landa wrote:

Hi,

should be 'map' in v.edit (for GRASS7) replaced by 'input/output'?
When options are specified incorrectly or the module crashes, vector
is not backuped, data are lost. The input/output paramaters would be
probably better for this module.

What do you think?

Martin

Sure, I think it's a good idea. Any extra robustness can't be a bad
thing. Is it not too difficult to code the changes?

--
Eric Patton

On 09/07/09 11:30, Martin Landa wrote:

Hi,

should be 'map' in v.edit (for GRASS7) replaced by 'input/output'?
When options are specified incorrectly or the module crashes, vector
is not backuped, data are lost. The input/output paramaters would be
probably better for this module.

Not too sure about this: this would mean that you create an intermediate map for every small edit. Why not create a flag for allowing the creation of a backup copy of the original map (which could be the default, so flag would then disable creation of backup map) ? Thus you get the security of being able to find the last version of the map before v.edit, without populating your mapset with a large number of intermediate maps.

Moritz

Hi,

2009/7/9 Moritz Lennert <mlennert@club.worldonline.be>:

should be 'map' in v.edit (for GRASS7) replaced by 'input/output'?
When options are specified incorrectly or the module crashes, vector
is not backuped, data are lost. The input/output paramaters would be
probably better for this module.

Not too sure about this: this would mean that you create an intermediate map
for every small edit. Why not create a flag for allowing the creation of a
backup copy of the original map (which could be the default, so flag would
then disable creation of backup map) ? Thus you get the security of being
able to find the last version of the map before v.edit, without populating
your mapset with a large number of intermediate maps.

or to make 'output' parameter optional. I.e. if 'output' is not given
then the vector map is modified directly otherwise saved as 'output'.

Martin

--
Martin Landa <landa.martin gmail.com> * http://gama.fsv.cvut.cz/~landa

On 09/07/09 16:56, Martin Landa wrote:

Hi,

2009/7/9 Moritz Lennert <mlennert@club.worldonline.be>:

should be 'map' in v.edit (for GRASS7) replaced by 'input/output'?
When options are specified incorrectly or the module crashes, vector
is not backuped, data are lost. The input/output paramaters would be
probably better for this module.

Not too sure about this: this would mean that you create an intermediate map
for every small edit. Why not create a flag for allowing the creation of a
backup copy of the original map (which could be the default, so flag would
then disable creation of backup map) ? Thus you get the security of being
able to find the last version of the map before v.edit, without populating
your mapset with a large number of intermediate maps.

or to make 'output' parameter optional. I.e. if 'output' is not given
then the vector map is modified directly otherwise saved as 'output'.

The problems I see with this are

- You don't know beforehand that v.edit will crash and so you might think that you don't need it...
- You need to find a new name for the output, even though it is the same map. This easily leads to name inflation à la map1, map2, map32, etc :wink:

With the security backup copy (in the same logic as many text editors, etc), you will always have the security (but can disable it if you prefer), but you can keep the same map name.

Moritz

Hi,

2009/7/9 Moritz Lennert <mlennert@club.worldonline.be>:

With the security backup copy (in the same logic as many text editors, etc),
you will always have the security (but can disable it if you prefer), but
you can keep the same map name.

what name should have backup copy, user defined or determined by the
module? I just think that this approach breaks standard GRASS CLI
rules. Cited from programmers manual:

"Each module which modifies and writes data must read from input= and
write to output= so that data may not be lost. For example v.spag
works on map= at in grass5.0 but if program (system) crashes or
threshold was specified incorrectly and vector was not backuped, data
were lost. In this case map= option should be replaced by input= and
output="

Martin

--
Martin Landa <landa.martin gmail.com> * http://gama.fsv.cvut.cz/~landa

On 09/07/09 17:17, Martin Landa wrote:

Hi,

2009/7/9 Moritz Lennert <mlennert@club.worldonline.be>:

With the security backup copy (in the same logic as many text editors, etc),
you will always have the security (but can disable it if you prefer), but
you can keep the same map name.

what name should have backup copy, user defined or determined by the
module? I just think that this approach breaks standard GRASS CLI
rules. Cited from programmers manual:

"Each module which modifies and writes data must read from input= and
write to output= so that data may not be lost. For example v.spag
works on map= at in grass5.0 but if program (system) crashes or
threshold was specified incorrectly and vector was not backuped, data
were lost. In this case map= option should be replaced by input= and
output="

If this is the rule, than you are right. Any way of making output=input with the --overwrite option ?

Moritz

Hi,

2009/7/9 Moritz Lennert <mlennert@club.worldonline.be>:

[...]

If this is the rule, than you are right. Any way of making output=input with
the --overwrite option ?

isn't it what I was suggesting? To make output optional. If output is
not given, then output=input (overwrite flag ignored).

Martin

--
Martin Landa <landa.martin gmail.com> * http://gama.fsv.cvut.cz/~landa

On 09/07/09 17:47, Martin Landa wrote:

Hi,

2009/7/9 Moritz Lennert <mlennert@club.worldonline.be>:

[...]

If this is the rule, than you are right. Any way of making output=input with
the --overwrite option ?

isn't it what I was suggesting? To make output optional. If output is
not given, then output=input (overwrite flag ignored).

Yep, ok. Just thought that according to the rules, output should be mandatory...

Moritz