[GRASS-SVN] r52138 - grass/trunk/lib/vector/neta
svn_grass at osgeo.org
svn_grass at osgeo.org
Tue Jun 19 09:29:39 PDT 2012
Author: mmetz
Date: 2012-06-19 09:29:39 -0700 (Tue, 19 Jun 2012)
New Revision: 52138
Modified:
grass/trunk/lib/vector/neta/utils.c
Log:
neta lib: layer check
Modified: grass/trunk/lib/vector/neta/utils.c
===================================================================
--- grass/trunk/lib/vector/neta/utils.c 2012-06-19 16:28:35 UTC (rev 52137)
+++ grass/trunk/lib/vector/neta/utils.c 2012-06-19 16:29:39 UTC (rev 52138)
@@ -226,14 +226,15 @@
{
int n, ni;
+ if (layer < 1)
+ G_fatal_error(_("'%s' must be > 0"), "layer");
+
n = Vect_get_num_lines(In);
*varray = Vect_new_varray(n);
ni = 0;
/* parse filter option and select appropriate lines */
if (where) {
- if (layer < 1)
- G_fatal_error(_("'%s' must be > 0 for '%s'"), "layer", "where");
if (cat)
G_warning(_("'where' and 'cats' parameters were supplied, cat will be ignored"));
ni = Vect_set_varray_from_db(In, layer, where, mask_type, 1, *varray);
@@ -243,8 +244,6 @@
return ni;
}
else if (cat) {
- if (layer < 1)
- G_fatal_error(_("'%s' must be > 0 for '%s'"), "layer", "categories");
ni = Vect_set_varray_from_cat_string(In, layer, cat, mask_type, 1, *varray);
if (ni == -1) {
G_warning(_("Problem loading category values"));
@@ -256,9 +255,6 @@
int ltype; /* line type */
struct line_cats *Cats;
- if (layer < 1)
- G_fatal_error(_("'%s' must be > 0 for '%s'"), "layer", "categories");
-
Cats = Vect_new_cats_struct();
for (i = 1; i <= n; i++) {
More information about the grass-commit
mailing list