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

« back to all changes in this revision

Viewing changes to imagery/i.rectify/exec.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:
13
13
#include <fcntl.h>
14
14
#include <time.h>
15
15
#include <unistd.h>
 
16
#include <math.h>
 
17
 
 
18
#include <grass/raster.h>
16
19
#include <grass/glocale.h>
 
20
 
17
21
#include "global.h"
18
22
 
19
23
int exec_rectify(int order, char *extension, char *interp_method)
30
34
    int colr_ok, cats_ok;
31
35
    long start_time, rectify_time;
32
36
 
 
37
    Rast_set_output_window(&target_window);
33
38
    G_message("-----------------------------------------------");
34
39
 
35
40
    /* rectify each file */
46
51
 
47
52
            select_current_env();
48
53
 
49
 
            cats_ok = G_read_cats(name, mapset, &cats) >= 0;
50
 
            colr_ok = G_read_colors(name, mapset, &colr) > 0;
 
54
            cats_ok = Rast_read_cats(name, mapset, &cats) >= 0;
 
55
            colr_ok = Rast_read_colors(name, mapset, &colr) > 0;
51
56
 
52
57
            /* Initialze History */
53
 
            if (G_read_history(name, mapset, &hist) < 0)
54
 
                G_short_history(result, type, &hist);
 
58
            if (Rast_read_history(name, mapset, &hist) < 0)
 
59
                Rast_short_history(result, type, &hist);
55
60
 
56
61
            time(&start_time);
57
62
 
59
64
                select_target_env();
60
65
 
61
66
                if (cats_ok) {
62
 
                    G_write_cats(result, &cats);
63
 
                    G_free_cats(&cats);
 
67
                    Rast_write_cats(result, &cats);
 
68
                    Rast_free_cats(&cats);
64
69
                }
65
70
                if (colr_ok) {
66
 
                    G_write_colors(result, G_mapset(), &colr);
67
 
                    G_free_colors(&colr);
 
71
                    Rast_write_colors(result, G_mapset(), &colr);
 
72
                    Rast_free_colors(&colr);
68
73
                }
69
74
 
70
75
                /* Write out History */
71
 
                G_command_history(&hist);
72
 
                G_write_history(result, &hist);
 
76
                Rast_command_history(&hist);
 
77
                Rast_write_history(result, &hist);
73
78
 
74
79
                select_current_env();
75
80
                time(&rectify_time);