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

« back to all changes in this revision

Viewing changes to imagery/i.ortho.photo/libes/elev.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:
5
5
**********************************************************/
6
6
#include <stdio.h>
7
7
#include <unistd.h>
 
8
#include <grass/gis.h>
 
9
#include <grass/ortholib.h>
 
10
#include <grass/glocale.h>
8
11
#include "orthophoto.h"
9
 
#include <grass/ortholib.h>
10
 
#include <grass/gis.h>
 
12
 
11
13
 
12
14
#define IN_BUF 200
13
15
 
14
16
 
15
17
/* Put the "elev" name into the block file "ELEV" */
16
 
int
17
 
I_put_group_elev(char *group, char *elev, char *mapset_elev, char *tl,
18
 
                 char *math_exp, char *units, char *nd)
 
18
int I_put_group_elev(char *group, char *elev, char *mapset_elev, char *tl,
 
19
                     char *math_exp, char *units, char *nd)
19
20
{
20
21
    FILE *fd;
21
22
 
36
37
}
37
38
 
38
39
 
39
 
/* Return the elev name from the block file ELEV */
40
 
int
41
 
I_get_group_elev(char *group, char *elev, char *mapset_elev, char *tl,
42
 
                 char *math_exp, char *units, char *nd)
 
40
/* Return the elev name from the block file ELEV
 
41
    returns 0 on fail,  1 on success */
 
42
int I_get_group_elev(char *group, char *elev, char *mapset_elev, char *tl,
 
43
                     char *math_exp, char *units, char *nd)
43
44
{
44
45
    char buf[IN_BUF];
45
46
    FILE *fd;
46
47
 
47
 
    if (!I_find_group_elev_file(group))
 
48
    if (!I_find_group_elev_file(group)) {
 
49
        G_warning(
 
50
            _("Unable to find elevation file for group <%s> in mapset <%s>"),
 
51
              group, G_mapset());
48
52
        return 0;
 
53
    }
49
54
 
50
55
    G_suppress_warnings(1);
51
56
    fd = I_fopen_group_elev_old(group);
52
57
    G_suppress_warnings(0);
 
58
 
53
59
    if (!fd) {
54
 
        G_warning
55
 
            ("unable to open elevation file for group [%s] in mapset [%s]",
56
 
             group, G_mapset());
 
60
        G_warning(
 
61
            _("Unable to open elevation file for group <%s> in mapset <%s>"),
 
62
              group, G_mapset());
57
63
        G_sleep(3);
58
64
 
59
65
        return 0;
73
79
    sscanf(buf, "no data values  :%s\n", nd);
74
80
    fclose(fd);
75
81
 
76
 
    return (1);
 
82
    return 1;
77
83
}