[GRASS-SVN] r43330 - grass/branches/develbranch_6/raster/r.in.poly
svn_grass at osgeo.org
svn_grass at osgeo.org
Sun Aug 29 03:56:34 EDT 2010
Author: hamish
Date: 2010-08-29 07:56:33 +0000 (Sun, 29 Aug 2010)
New Revision: 43330
Modified:
grass/branches/develbranch_6/raster/r.in.poly/get_item.c
grass/branches/develbranch_6/raster/r.in.poly/main.c
grass/branches/develbranch_6/raster/r.in.poly/poly2rast.c
Log:
more precise surpression of warnings (needed at all?), add bad-coord warnings (side issue from #1142)
Modified: grass/branches/develbranch_6/raster/r.in.poly/get_item.c
===================================================================
--- grass/branches/develbranch_6/raster/r.in.poly/get_item.c 2010-08-29 07:37:59 UTC (rev 43329)
+++ grass/branches/develbranch_6/raster/r.in.poly/get_item.c 2010-08-29 07:56:33 UTC (rev 43330)
@@ -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/develbranch_6/raster/r.in.poly/main.c
===================================================================
--- grass/branches/develbranch_6/raster/r.in.poly/main.c 2010-08-29 07:37:59 UTC (rev 43329)
+++ grass/branches/develbranch_6/raster/r.in.poly/main.c 2010-08-29 07:56:33 UTC (rev 43330)
@@ -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/develbranch_6/raster/r.in.poly/poly2rast.c
===================================================================
--- grass/branches/develbranch_6/raster/r.in.poly/poly2rast.c 2010-08-29 07:37:59 UTC (rev 43329)
+++ grass/branches/develbranch_6/raster/r.in.poly/poly2rast.c 2010-08-29 07:56:33 UTC (rev 43330)
@@ -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