~ubuntu-branches/ubuntu/precise/grass/precise

« back to all changes in this revision

Viewing changes to vector/v.proj/main.c

  • Committer: Bazaar Package Importer
  • Author(s): Francesco Paolo Lovergine
  • Date: 2011-04-13 17:08:41 UTC
  • mfrom: (8.1.7 sid)
  • Revision ID: james.westby@ubuntu.com-20110413170841-ss1t9bic0d0uq0gz
Tags: 6.4.1-1
* New upstream version.
* Now build-dep on libjpeg-dev and current libreadline6-dev.
* Removed patch swig: obsolete.
* Policy bumped to 3.9.2, without changes.

Show diffs side-by-side

added added

removed removed

Lines of Context:
60
60
    G_gisinit(argv[0]);
61
61
 
62
62
    module = G_define_module();
63
 
    module->keywords = _("vector, projection");
64
 
    module->description = _("Allows projection conversion of vector maps.");
 
63
    module->keywords = _("vector, projection, transformation");
 
64
    module->description = _("Re-projects a vector map from one location to the current location.");
65
65
 
66
66
    /* set up the options and flags for the command line parser */
67
67
 
68
68
    mapopt = G_define_standard_option(G_OPT_V_INPUT);
69
 
    mapopt->gisprompt = NULL;
70
69
    mapopt->required = NO;
71
 
 
 
70
    mapopt->guisection = _("Source");
 
71
    
72
72
    ilocopt = G_define_option();
73
73
    ilocopt->key = "location";
74
74
    ilocopt->type = TYPE_STRING;
75
75
    ilocopt->required = YES;
76
76
    ilocopt->description = _("Location containing input vector map");
77
 
 
 
77
    ilocopt->gisprompt = "old,location,location";
 
78
    ilocopt->key_desc = "name";
 
79
    
78
80
    isetopt = G_define_option();
79
81
    isetopt->key = "mapset";
80
82
    isetopt->type = TYPE_STRING;
81
83
    isetopt->required = NO;
82
84
    isetopt->description = _("Mapset containing input vector map");
 
85
    isetopt->gisprompt = "old,mapset,mapset";
 
86
    isetopt->key_desc = "name";
 
87
    isetopt->guisection = _("Source");
83
88
 
84
89
    ibaseopt = G_define_option();
85
90
    ibaseopt->key = "dbase";
86
91
    ibaseopt->type = TYPE_STRING;
87
92
    ibaseopt->required = NO;
88
93
    ibaseopt->description = _("Path to GRASS database of input location");
 
94
    ibaseopt->gisprompt = "old,dbase,dbase";
 
95
    ibaseopt->key_desc = "path";
 
96
    ibaseopt->guisection = _("Source");
89
97
 
90
98
    omapopt = G_define_standard_option(G_OPT_V_OUTPUT);
91
99
    omapopt->required = NO;
 
100
    omapopt->description = _("Name for output vector map (default: input)");
 
101
    omapopt->guisection = _("Target");
92
102
 
93
103
    flag.list = G_define_flag();
94
104
    flag.list->key = 'l';
100
110
    flag.transformz->label =
101
111
        _("Assume z co-ordinate is ellipsoidal height and "
102
112
          "transform if possible");
 
113
    flag.transformz->guisection = _("Target");
103
114
 
104
115
    /* The parser checks if the map already exists in current mapset,
105
116
       we switch out the check and do it
153
164
    if (stat >= 0) {            /* yes, we can access the mapset */
154
165
        /* if requested, list the vector maps in source location - MN 5/2001 */
155
166
        if (flag.list->answer) {
 
167
            int i;
 
168
            char **list;
156
169
            G_verbose_message(_("Checking location <%s> mapset <%s>"),
157
170
                              iloc_name, iset_name);
158
 
            G_list_element("vector", "vector", iset_name, 0);
 
171
            list = G_list(G_ELEMENT_VECTOR, G__getenv("GISDBASE"),
 
172
                          G__getenv("LOCATION_NAME"), iset_name);
 
173
            for (i = 0; list[i]; i++) {
 
174
                fprintf(stdout, "%s\n", list[i]);
 
175
            }
 
176
            fflush(stdout);
159
177
            exit(EXIT_SUCCESS); /* leave v.proj after listing */
160
178
        }
161
179