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

« back to all changes in this revision

Viewing changes to imagery/i.smap/shapiro/read_sig.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
 
#include <stdlib.h>
2
 
#include <grass/imagery.h>
3
 
#include <grass/glocale.h>
4
 
#include "bouman.h"
5
 
 
6
 
 
7
 
int read_signatures(struct parms *parms, struct SigSet *S)
8
 
{
9
 
    FILE *fd;
10
 
    struct Ref Ref;
11
 
 
12
 
    if (!I_get_subgroup_ref(parms->group, parms->subgroup, &Ref))
13
 
        G_fatal_error(_("Unable to read REF file for subgroup <%s> in group <%s>"),
14
 
                      parms->subgroup, parms->group);
15
 
 
16
 
    if (Ref.nfiles <= 0)
17
 
        G_fatal_error(_("Subgroup <%s> in group <%s> contains no raster maps"),
18
 
                      parms->subgroup, parms->group);
19
 
 
20
 
    fd = I_fopen_sigset_file_old(parms->group, parms->subgroup,
21
 
                                 parms->sigfile);
22
 
    if (fd == NULL)
23
 
        G_fatal_error(_("Unable to read signature file <%s>"),
24
 
                      parms->sigfile);
25
 
    
26
 
    if (I_ReadSigSet(fd, S) < 0 || Ref.nfiles != S->nbands)
27
 
        G_fatal_error(_("Signature file <%s> is invalid"), parms->sigfile);
28
 
 
29
 
    if (S->ClassSig == NULL || S->title == NULL)
30
 
        G_fatal_error(_("Signature file <%s> is empty"), parms->sigfile);
31
 
 
32
 
    fclose(fd);
33
 
 
34
 
    return 0;
35
 
}