[GRASS-SVN] r43572 -
grass/branches/releasebranch_6_4/raster/r.in.poly
svn_grass at osgeo.org
svn_grass at osgeo.org
Tue Sep 21 08:26:40 EDT 2010
Author: neteler
Date: 2010-09-21 12:26:40 +0000 (Tue, 21 Sep 2010)
New Revision: 43572
Modified:
grass/branches/releasebranch_6_4/raster/r.in.poly/get_item.c
grass/branches/releasebranch_6_4/raster/r.in.poly/main.c
grass/branches/releasebranch_6_4/raster/r.in.poly/poly2rast.c
Log:
backport: more precise surpression of warnings (needed at all?), add bad-coord warnings (side issue from #1142)
Modified: grass/branches/releasebranch_6_4/raster/r.in.poly/get_item.c
===================================================================
--- grass/branches/releasebranch_6_4/raster/r.in.poly/get_item.c 2010-09-21 12:19:28 UTC (rev 43571)
+++ grass/branches/releasebranch_6_4/raster/r.in.poly/get_item.c 2010-09-21 12:26:40 UTC (rev 43572)
@@ -1,4 +1,6 @@
#include <grass/gis.h>
+#include <grass/glocale.h>
+
int get_item(FILE * fd, int *type, long *cat, double **x, double **y,
int *count, struct Categories *labels)
{
@@ -69,13 +71,20 @@
}
continue;
}
+ if (sscanf(buf, "%s %s", east, north) != 2) {
+ G_warning(_("Illegal coordinate <%s, %s>, skipping."), east, north);
+ continue;
+ }
- if (sscanf(buf, "%s %s", east, north) != 2)
+ if (!G_scan_northing(north, &n, G_projection())) {
+ G_warning(_("Illegal north coordinate <%s>, skipping."), north);
continue;
- if (!G_scan_northing(north, &n, G_projection()))
+ }
+
+ if (!G_scan_easting(east, &e, G_projection())) {
+ G_warning(_("Illegal east coordinate <%s>, skipping."), east);
continue;
- if (!G_scan_easting(east, &e, G_projection()))
- continue;
+ }
if (*count >= nalloc) {
nalloc += 32;
Modified: grass/branches/releasebranch_6_4/raster/r.in.poly/main.c
===================================================================
--- grass/branches/releasebranch_6_4/raster/r.in.poly/main.c 2010-09-21 12:19:28 UTC (rev 43571)
+++ grass/branches/releasebranch_6_4/raster/r.in.poly/main.c 2010-09-21 12:26:40 UTC (rev 43572)
@@ -58,8 +58,5 @@
if (n < 1)
G_fatal_error(_("Minimum number of rows to hold in memory is 1"));
- /* otherwise get complaints about window changes */
- G_suppress_warnings(1);
-
exit(poly_to_rast(input->answer, output->answer, title->answer, n));
}
Modified: grass/branches/releasebranch_6_4/raster/r.in.poly/poly2rast.c
===================================================================
--- grass/branches/releasebranch_6_4/raster/r.in.poly/poly2rast.c 2010-09-21 12:19:28 UTC (rev 43571)
+++ grass/branches/releasebranch_6_4/raster/r.in.poly/poly2rast.c 2010-09-21 12:26:40 UTC (rev 43572)
@@ -42,7 +42,12 @@
G_init_cats((CELL) 0, title, &labels);
format = getformat(ifd);
+
+ /* ?? otherwise get complaints about window changes */
+ G_suppress_warnings(TRUE);
npasses = begin_rasterization(nrows, format);
+ G_suppress_warnings(FALSE);
+
pass = 0;
do {
More information about the grass-commit
mailing list