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

« back to all changes in this revision

Viewing changes to raster/r.le/r.le.setup/polytocell/save_area.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
 
/* %W%  %G%  */
2
 
#include "ply_to_cll.h"
3
 
#define START_ROW       xy[incr].row
4
 
#define STOP_ROW        xy[incr+1].row
5
 
#define START_COL       xy[incr].col
6
 
#define STOP_COL        xy[incr+1].col
7
 
 
8
 
void save_area(struct element *xy, int num_points, int category)
9
 
{
10
 
    int incr;
11
 
    float first_cell, last_cell;
12
 
 
13
 
    for (incr = 0; incr < num_points;) {
14
 
 
15
 
        if (START_ROW != STOP_ROW) {
16
 
            fprintf(stderr, "ERROR: start and end row not same\n");
17
 
            for (incr = 0; incr < num_points; incr += 2) {
18
 
                fprintf(stderr, "%d: %d %f %d %f\n",
19
 
                        incr, xy[incr].row, xy[incr].col,
20
 
                        xy[incr + 1].row, xy[incr + 1].col);
21
 
            }
22
 
            incr++;
23
 
            continue;
24
 
        }
25
 
 
26
 
        first_cell = START_COL + 1.;
27
 
        last_cell = STOP_COL;
28
 
        if (last_cell >= first_cell)
29
 
            write_record(START_ROW, first_cell, last_cell, category);
30
 
        incr += 2;
31
 
    }
32
 
}