~ubuntu-branches/ubuntu/vivid/grass/vivid-proposed

« back to all changes in this revision

Viewing changes to imagery/i.ortho.photo/i.photo.init/main.c

  • Committer: Package Import Robot
  • Author(s): Bas Couwenberg
  • Date: 2015-02-20 23:12:08 UTC
  • mfrom: (8.2.6 experimental)
  • Revision ID: package-import@ubuntu.com-20150220231208-1u6qvqm84v430b10
Tags: 7.0.0-1~exp1
* New upstream release.
* Update python-ctypes-ternary.patch to use if/else instead of and/or.
* Drop check4dev patch, rely on upstream check.
* Add build dependency on libpq-dev to grass-dev for libpq-fe.h.
* Drop patches applied upstream, refresh remaining patches.
* Update symlinks for images switched from jpg to png.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
 
2
 
/****************************************************************************
3
 
 *
4
 
 * MODULE:       i.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 info */
77
 
    if (I_find_initial(group.name)) {
78
 
        have_old = 1;
79
 
        I_get_init_info(group.name, &group.camera_exp);
80
 
    }
81
 
 
82
 
    /* modify info */
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
 
}