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

« back to all changes in this revision

Viewing changes to imagery/i.ortho.photo/photo.init/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:       photo.init
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:      Creates or modifies entries in a camera initial exposure
13
 
 *               station file for imagery group referenced by a sub-block
14
 
 * COPYRIGHT:    (C) 1999-2008 by the GRASS Development Team
15
 
 *
16
 
 *               This program is free software under the GNU General Public
17
 
 *               License (>=v2). Read the file COPYING that comes with GRASS
18
 
 *               for details.
19
 
 *
20
 
 *****************************************************************************/
21
 
 
22
 
#define  MAIN  1
23
 
#include <stdlib.h>
24
 
#include <string.h>
25
 
#include <grass/gis.h>
26
 
#include <grass/glocale.h>
27
 
#include "globals.h"
28
 
 
29
 
 
30
 
int main(int argc, char *argv[])
31
 
{
32
 
    struct GModule *module;
33
 
    struct Option *group_opt;
34
 
 
35
 
    char name[GNAME_MAX];
36
 
    int have_old;
37
 
 
38
 
    /* must run in a term window */
39
 
    G_putenv("GRASS_UI_TERM", "1");
40
 
 
41
 
    G_gisinit(argv[0]);
42
 
 
43
 
    module = G_define_module();
44
 
    module->keywords = _("imagery, orthorectify");
45
 
    module->description =
46
 
        _("Interactively creates or modifies entries in a camera "
47
 
          "initial exposure station file for imagery group referenced "
48
 
          "by a sub-block.");
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(name, group_opt->answer);
59
 
 
60
 
    /* get group ref */
61
 
    strcpy(group.name, name);
62
 
 
63
 
    if (!I_find_group(group.name)) {
64
 
        G_fatal_error(_("Group [%s] not found"), name);
65
 
    }
66
 
    G_debug(1, "Found group %s", group.name);
67
 
 
68
 
 
69
 
/*******************
70
 
    I_get_Ortho_Image_Group_Ref(group.name, &group.group_ref);
71
 
    nfiles = block.block_ref.nfiles;
72
 
    G_debug(1, "Got group ref");
73
 
*******************/
74
 
 
75
 
 
76
 
    /* get initial camera exposure infor */
77
 
    if (I_find_initial(group.name)) {
78
 
        have_old = 1;
79
 
        I_get_init_info(group.name, &group.camera_exp);
80
 
    }
81
 
 
82
 
    /* modifiy infor */
83
 
    mod_init_info(have_old, &group.camera_exp);
84
 
 
85
 
    /* save info */
86
 
    I_put_init_info(group.name, &group.camera_exp);
87
 
 
88
 
    exit(EXIT_SUCCESS);
89
 
}