[GRASS-SVN] r43580 -
grass/branches/releasebranch_6_4/raster/r.out.ascii
svn_grass at osgeo.org
svn_grass at osgeo.org
Tue Sep 21 08:55:35 EDT 2010
Author: neteler
Date: 2010-09-21 12:55:35 +0000 (Tue, 21 Sep 2010)
New Revision: 43580
Modified:
grass/branches/releasebranch_6_4/raster/r.out.ascii/formspecific.c
Log:
backport: output correct precision for different projection types (bugs #654 and #335)
Modified: grass/branches/releasebranch_6_4/raster/r.out.ascii/formspecific.c
===================================================================
--- grass/branches/releasebranch_6_4/raster/r.out.ascii/formspecific.c 2010-09-21 12:54:51 UTC (rev 43579)
+++ grass/branches/releasebranch_6_4/raster/r.out.ascii/formspecific.c 2010-09-21 12:55:35 UTC (rev 43580)
@@ -142,12 +142,16 @@
fprintf(fp, "%d %d\n", region.cols, region.rows);
/* Projection set to -1 to force floating point output */
- G_format_easting(region.west + region.ew_res / 2., fromc, -1);
- G_format_easting(region.east - region.ew_res / 2., toc, -1);
+ G_format_easting(region.west + region.ew_res / 2., fromc,
+ G_projection() == PROJECTION_LL ? -1 : 0);
+ G_format_easting(region.east - region.ew_res / 2., toc,
+ G_projection() == PROJECTION_LL ? -1 : 0);
fprintf(fp, "%s %s\n", fromc, toc);
- G_format_northing(region.south + region.ns_res / 2., fromc, -1);
- G_format_northing(region.north - region.ns_res / 2., toc, -1);
+ G_format_northing(region.south + region.ns_res / 2., fromc,
+ G_projection() == PROJECTION_LL ? -1 : 0);
+ G_format_northing(region.north - region.ns_res / 2., toc,
+ G_projection() == PROJECTION_LL ? -1 : 0);
fprintf(fp, "%s %s\n", fromc, toc);
G_get_fp_range_min_max(&range, &Z_MIN, &Z_MAX);
More information about the grass-commit
mailing list