[GRASS-SVN] r41835 - grass/branches/develbranch_6/general/g.region

svn_grass at osgeo.org svn_grass at osgeo.org
Tue Apr 13 05:42:31 EDT 2010


Author: hamish
Date: 2010-04-13 05:42:17 -0400 (Tue, 13 Apr 2010)
New Revision: 41835

Modified:
   grass/branches/develbranch_6/general/g.region/local_proto.h
   grass/branches/develbranch_6/general/g.region/main.c
   grass/branches/develbranch_6/general/g.region/printwindow.c
Log:
add a flag to print region in a style suitable for WMS (merge from trunk)

Modified: grass/branches/develbranch_6/general/g.region/local_proto.h
===================================================================
--- grass/branches/develbranch_6/general/g.region/local_proto.h	2010-04-13 09:29:34 UTC (rev 41834)
+++ grass/branches/develbranch_6/general/g.region/local_proto.h	2010-04-13 09:42:17 UTC (rev 41835)
@@ -11,6 +11,7 @@
 #define PRINT_MBBOX  0x80
 #define PRINT_NANGLE 0x100
 #define PRINT_GMT    0x200
+#define PRINT_WMS    0x400
 
 /* adjust.c */
 int adjust_window(struct Cell_head *, int, int, int);

Modified: grass/branches/develbranch_6/general/g.region/main.c
===================================================================
--- grass/branches/develbranch_6/general/g.region/main.c	2010-04-13 09:29:34 UTC (rev 41834)
+++ grass/branches/develbranch_6/general/g.region/main.c	2010-04-13 09:42:17 UTC (rev 41835)
@@ -47,7 +47,7 @@
 	struct Flag
 	    *update, *print, *gprint, *lprint, *eprint, *nangle,
 	    *center, *res_set, *dist_res, *dflt, *z, *savedefault,
-	    *bbox, *gmt_style;
+	    *bbox, *gmt_style, *wms_style;
     } flag;
     struct
     {
@@ -111,6 +111,12 @@
 	_("Print the current region in GMT style");
     flag.gmt_style->guisection = _("Print");
 
+    flag.wms_style = G_define_flag();
+    flag.wms_style->key = 'w';
+    flag.wms_style->description =
+	_("Print the current region in WMS style");
+    flag.wms_style->guisection = _("Print");
+
     flag.dist_res = G_define_flag();
     flag.dist_res->key = 'm';
     flag.dist_res->description =
@@ -381,6 +387,9 @@
     if (flag.gmt_style->answer)
 	print_flag |= PRINT_GMT;
 
+    if (flag.wms_style->answer)
+	print_flag |= PRINT_WMS;
+
     if (flag.nangle->answer)
 	print_flag |= PRINT_NANGLE;
 

Modified: grass/branches/develbranch_6/general/g.region/printwindow.c
===================================================================
--- grass/branches/develbranch_6/general/g.region/printwindow.c	2010-04-13 09:29:34 UTC (rev 41834)
+++ grass/branches/develbranch_6/general/g.region/printwindow.c	2010-04-13 09:42:17 UTC (rev 41835)
@@ -473,7 +473,16 @@
     if (print_flag & PRINT_GMT)
 	fprintf(stdout, "%s/%s/%s/%s\n", west, east, south, north);
 
+    /* flag.wms_style */
+    if (print_flag & PRINT_WMS) {
+	G_format_northing(window->north, north, -1);
+	G_format_northing(window->south, south, -1);
+	G_format_easting(window->east, east, -1);
+	G_format_easting(window->west, west, -1);
+	fprintf(stdout, "bbox=%s,%s,%s,%s\n", west, south, east, north);
+    }
 
+
     /* flag.nangle */
     if (print_flag & PRINT_NANGLE) {
 	double convergence;



More information about the grass-commit mailing list