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

« back to all changes in this revision

Viewing changes to vector/v.transform/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:
82
82
    tozero_flag = G_define_flag();
83
83
    tozero_flag->key = 't';
84
84
    tozero_flag->description = _("Shift all z values to bottom=0");
 
85
    tozero_flag->guisection = _("Custom");
85
86
 
86
87
    print_mat_flag = G_define_flag();
87
88
    print_mat_flag->key = 'm';
88
89
    print_mat_flag->description =
89
90
        _("Print the transformation matrix to stdout");
90
 
 
 
91
    
91
92
    /* remove in GRASS7 */
92
93
    shift_flag = G_define_flag();
93
94
    shift_flag->key = 's';
95
96
        _("Instead of points use transformation parameters "
96
97
          "(xshift, yshift, zshift, xscale, yscale, zscale, zrot)");
97
98
    shift_flag->guisection = _("Custom");
98
 
 
 
99
        
99
100
    vold = G_define_standard_option(G_OPT_V_INPUT);
100
101
 
 
102
    field = G_define_standard_option(G_OPT_V_FIELD);
 
103
    
101
104
    vnew = G_define_standard_option(G_OPT_V_OUTPUT);
102
105
 
103
106
    pointsfile = G_define_standard_option(G_OPT_F_INPUT);
108
111
                                "(xshift, yshift, zshift, xscale, yscale, zscale, zrot) are used instead");
109
112
 
110
113
    pointsfile->gisprompt = "old_file,file,points";
111
 
 
 
114
    pointsfile->guisection = _("Points");
 
115
    
112
116
    xshift = G_define_option();
113
117
    xshift->key = "xshift";
114
118
    xshift->type = TYPE_DOUBLE;
176
180
    table = G_define_standard_option(G_OPT_TABLE);
177
181
    table->description =
178
182
        _("Name of table containing transformation parameters");
179
 
    table->guisection = _("Custom");
 
183
    table->guisection = _("Attributes");
180
184
 
181
 
    columns = G_define_standard_option(G_OPT_COLUMNS);
 
185
    columns = G_define_option();
 
186
    columns->key = "columns";
 
187
    columns->type = TYPE_STRING;
 
188
    columns->required = NO;
 
189
    columns->multiple = NO;
182
190
    columns->label =
183
191
        _("Name of attribute column(s) used as transformation parameters");
184
192
    columns->description =
185
193
        _("Format: parameter:column, e.g. xshift:xs,yshift:ys,zrot:zr");
186
 
    columns->guisection = _("Custom");
187
 
 
188
 
    field = G_define_standard_option(G_OPT_V_FIELD);
189
 
    field->guisection = _("Custom");
 
194
    columns->guisection = _("Attributes");
190
195
 
191
196
    if (G_parser(argc, argv))
192
197
        exit(EXIT_FAILURE);
237
242
        G_fatal_error(_("Vector map <%s> not found"), vold->answer);
238
243
 
239
244
    Vect_open_old(&Old, vold->answer, mapset);
240
 
 
241
 
    Vect_open_new(&New, vnew->answer, Vect_is_3d(&Old) || zshift->answer);
242
 
 
 
245
    
 
246
    Vect_open_new(&New, vnew->answer, Vect_is_3d(&Old) || tozero_flag->answer ||
 
247
                  strcmp(zshift->answer, "0.0") || strcmp(zscale->answer, "1.0") ||
 
248
                  strcmp(zrot->answer, "0.0") ? WITH_Z : WITHOUT_Z);
 
249
    
243
250
    /* copy and set header */
244
251
    Vect_copy_head_data(&Old, &New);
245
252