[GRASS-dev] New v.digit

Michael Barton michael.barton at asu.edu
Sun Feb 25 00:41:03 EST 2007


Glynn,

To go along with your impressive update of v.digit, I was able to now
re-institute automatic background display of any active layers in the GIS
Manager. This was functional in the x11 based d.m, but hasn't been
functional in the new display architecture. Now that it's all in a TclTk
canvas, I was able to get this running again.

I'm currently using the -n switch. If you get rid of it, I can take it out
of the v.digit command (and shorten the code a bit) in vector.tcl.

Michael
 


On 2/24/07 2:59 PM, "Glynn Clements" <glynn at gclements.plus.com> wrote:

> 
> Michael Barton wrote:
> 
>>> A question: 
>>> What's the idea of the "-n" flag? I could not find out the last
>>> years :-) Can we disable it (in the common "deprecated" way)?
>> 
>> AFAICT, we still need the -n for situations where v.digit is run with the
>> name of a map that does not yet exist. Using the -n flag will create a new
>> vector map with the specified name and let you start digitizing this map.
> 
> The code in question is:
> 
>     /* Open map */
>     mapset = G_find_vector2 (map_opt->answer, G_mapset());
>     if ( mapset == NULL ) {
>        if ( new_f->answer ) {
>   G_message(_("New empty map created."));
>   Vect_open_new (&Map, map_opt->answer, 0 );
>   Vect_build ( &Map, NULL );
>   Vect_close (&Map);
>   Vect_open_update (&Map, map_opt->answer, G_mapset());
>        } else {
>   G_message(_("Map does not exist. Add flag -n to create a new map."));
>   exit(EXIT_FAILURE);
>        }
>     } else {
> Vect_set_open_level(2);
> Vect_open_update (&Map, map_opt->answer, mapset);
>     }
> 
> The -n flag is only checked if the map doesn't already exist. In that
> case, it could just skip the -n check and create the map
> automatically.
> 
> The only issue is whether there is a reason not to.

__________________________________________
Michael Barton, Professor of Anthropology
School of Human Evolution & Social Change
Center for Social Dynamics & Complexity
Arizona State University

phone: 480-965-6213
fax: 480-965-7671
www: http://www.public.asu.edu/~cmbarton





More information about the grass-dev mailing list