[GRASS-SVN] r43331 - grass/trunk/raster/r.in.poly
svn_grass at osgeo.org
svn_grass at osgeo.org
Sun Aug 29 03:58:44 EDT 2010
Author: hamish
Date: 2010-08-29 07:58:44 +0000 (Sun, 29 Aug 2010)
New Revision: 43331
Modified:
grass/trunk/raster/r.in.poly/get_item.c
grass/trunk/raster/r.in.poly/main.c
grass/trunk/raster/r.in.poly/poly2rast.c
Log:
more precise surpression of warnings (needed at all?), add bad-coord warnings (side issue from #1142; merge from devbr6)
Modified: grass/trunk/raster/r.in.poly/get_item.c
===================================================================
--- grass/trunk/raster/r.in.poly/get_item.c 2010-08-29 07:56:33 UTC (rev 43330)
+++ grass/trunk/raster/r.in.poly/get_item.c 2010-08-29 07:58:44 UTC (rev 43331)
@@ -1,5 +1,7 @@
#include <grass/gis.h>
#include <grass/raster.h>
+#include <grass/glocale.h>
+
int get_item(FILE * fd, int *type, long *cat, double **x, double **y,
int *count, struct Categories *labels)
{
@@ -70,13 +72,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/trunk/raster/r.in.poly/main.c
===================================================================
--- grass/trunk/raster/r.in.poly/main.c 2010-08-29 07:56:33 UTC (rev 43330)
+++ grass/trunk/raster/r.in.poly/main.c 2010-08-29 07:58:44 UTC (rev 43331)
@@ -59,8 +59,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/trunk/raster/r.in.poly/poly2rast.c
===================================================================
--- grass/trunk/raster/r.in.poly/poly2rast.c 2010-08-29 07:56:33 UTC (rev 43330)
+++ grass/trunk/raster/r.in.poly/poly2rast.c 2010-08-29 07:58:44 UTC (rev 43331)
@@ -41,7 +41,12 @@
Rast_init_cats(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