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

« back to all changes in this revision

Viewing changes to imagery/i.ortho.photo/i.photo.target/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:
 
1
 
 
2
/****************************************************************************
 
3
 *
 
4
 * MODULE:       i.photo.target
 
5
 * AUTHOR(S):    Mike Baba,  DBA Systems, Inc. (original contributor)
 
6
 *               Markus Neteler <neteler itc.it>,
 
7
 *               Roberto Flor <flor itc.it>, 
 
8
 *               Bernhard Reiter <bernhard intevation.de>, 
 
9
 *               Glynn Clements <glynn gclements.plus.com>
 
10
 *               Hamish Bowman
 
11
 *
 
12
 * PURPOSE:      Select target location and mapset
 
13
 * COPYRIGHT:    (C) 1999-2008 by the GRASS Development Team
 
14
 *
 
15
 *               This program is free software under the GNU General Public
 
16
 *               License (>=v2). Read the file COPYING that comes with GRASS
 
17
 *               for details.
 
18
 *
 
19
 *****************************************************************************/
 
20
 
 
21
#include <stdlib.h>
 
22
#include <stdio.h>
 
23
#include <string.h>
 
24
#include <grass/gis.h>
 
25
#include <grass/imagery.h>
 
26
#include <grass/glocale.h>
 
27
#include "orthophoto.h"
 
28
#include "local_proto.h"
 
29
 
 
30
int main(int argc, char *argv[])
 
31
{
 
32
    struct GModule *module;
 
33
    struct Option *group_opt;
 
34
 
 
35
    char location[GMAPSET_MAX];
 
36
    char mapset[GMAPSET_MAX];
 
37
    char group[GNAME_MAX];
 
38
 
 
39
 
 
40
    /* must run in a term window */
 
41
    G_putenv("GRASS_UI_TERM", "1");
 
42
 
 
43
    G_gisinit(argv[0]);
 
44
 
 
45
    module = G_define_module();
 
46
    module->keywords = _("imagery, orthorectify");
 
47
    module->description =
 
48
        _("Interactively select or modify the imagery group target.");
 
49
 
 
50
    group_opt = G_define_standard_option(G_OPT_I_GROUP);
 
51
    group_opt->description =
 
52
        _("Name of imagery group for ortho-rectification");
 
53
 
 
54
    if (G_parser(argc, argv))
 
55
        exit(EXIT_FAILURE);
 
56
 
 
57
 
 
58
    strcpy(group, group_opt->answer);
 
59
 
 
60
    I_get_target(group, location, mapset);
 
61
    G__create_alt_env();
 
62
    ask_target(group, location, mapset);
 
63
    G__switch_env();
 
64
    I_put_target(group, location, mapset);
 
65
 
 
66
    G_message(_("Group [%s] targeted for location [%s], mapset [%s]"),
 
67
            group, location, mapset);
 
68
 
 
69
    exit(EXIT_SUCCESS);
 
70
}