[GRASS-SVN] r56616 - grass/trunk/raster/r.grow.distance
svn_grass at osgeo.org
svn_grass at osgeo.org
Wed Jun 5 08:22:22 PDT 2013
Author: mmetz
Date: 2013-06-05 08:22:22 -0700 (Wed, 05 Jun 2013)
New Revision: 56616
Modified:
grass/trunk/raster/r.grow.distance/main.c
Log:
r.grow.distance: output distance in meters for lat/lon is only possible with metric=geodesic
Modified: grass/trunk/raster/r.grow.distance/main.c
===================================================================
--- grass/trunk/raster/r.grow.distance/main.c 2013-06-05 15:11:29 UTC (rev 56615)
+++ grass/trunk/raster/r.grow.distance/main.c 2013-06-05 15:22:22 UTC (rev 56616)
@@ -37,6 +37,7 @@
static double (*distance) (double dx, double dy);
static double xres, yres;
+#undef MAX
#define MAX(a, b) ((a) > (b) ? (a) : (b))
static double distance_euclidean_squared(double dx, double dy)
@@ -209,6 +210,12 @@
G_fatal_error(_("Unknown metric: '%s'"), opt.met->answer);
if (flag.m->answer) {
+ if (window.proj == PROJECTION_LL &&
+ strcmp(opt.met->answer, "geodesic") != 0) {
+ G_fatal_error(_("Output distance in meters for lat/lon is only possible with '%s=%s'"),
+ opt.met->key, "geodesic");
+ }
+
scale = G_database_units_to_meters_factor();
if (strcmp(opt.met->answer, "squared") == 0)
scale *= scale;
@@ -300,7 +307,7 @@
Rast_set_c_null_value(old_x_row, ncols);
Rast_set_c_null_value(old_y_row, ncols);
- G_message(_("Writing output raster maps..."), opt.in->answer);
+ G_message(_("Writing output raster maps..."));
for (row = 0; row < nrows; row++) {
int irow = nrows - 1 - row;
off_t offset =
More information about the grass-commit
mailing list