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

« back to all changes in this revision

Viewing changes to imagery/i.rectify/nearest.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:
6
6
 
7
7
#include <math.h>
8
8
#include <grass/gis.h>
 
9
#include <grass/raster.h>
9
10
#include "global.h"
10
11
 
11
12
void p_nearest(struct cache *ibuffer,   /* input buffer                  */
26
27
 
27
28
    /* check for out of bounds - if out of bounds set NULL value     */
28
29
    if (row < 0 || row >= cellhd->rows || col < 0 || col >= cellhd->cols) {
29
 
        G_set_null_value(obufptr, 1, cell_type);
 
30
        Rast_set_null_value(obufptr, 1, cell_type);
30
31
        return;
31
32
    }
32
33
 
33
34
    cellp = CPTR(ibuffer, row, col);
34
35
 
35
 
    if (G_is_d_null_value(cellp)) {
36
 
        G_set_null_value(obufptr, 1, cell_type);
 
36
    if (Rast_is_d_null_value(cellp)) {
 
37
        Rast_set_null_value(obufptr, 1, cell_type);
37
38
        return;
38
39
    }
39
40
 
40
 
    G_set_raster_value_d(obufptr, *cellp, cell_type);
 
41
    Rast_set_d_value(obufptr, *cellp, cell_type);
41
42
}