[GRASS-SVN] r41834 - grass/trunk/general/g.region

svn_grass at osgeo.org svn_grass at osgeo.org
Tue Apr 13 05:29:46 EDT 2010


Author: hamish
Date: 2010-04-13 05:29:34 -0400 (Tue, 13 Apr 2010)
New Revision: 41834

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

Modified: grass/trunk/general/g.region/local_proto.h
===================================================================
--- grass/trunk/general/g.region/local_proto.h	2010-04-13 08:42:00 UTC (rev 41833)
+++ grass/trunk/general/g.region/local_proto.h	2010-04-13 09:29:34 UTC (rev 41834)
@@ -11,6 +11,7 @@
 #define PRINT_MBBOX  0x80
 #define PRINT_NANGLE 0x100
 #define PRINT_GMT    0x200
+#define PRINT_WMS    0x400
 
 /* zoom.c */
 int zoom(struct Cell_head *, const char *, const char *);

Modified: grass/trunk/general/g.region/main.c
===================================================================
--- grass/trunk/general/g.region/main.c	2010-04-13 08:42:00 UTC (rev 41833)
+++ grass/trunk/general/g.region/main.c	2010-04-13 09:29:34 UTC (rev 41834)
@@ -45,7 +45,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
     {
@@ -103,6 +103,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 =
@@ -367,6 +373,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/trunk/general/g.region/printwindow.c
===================================================================
--- grass/trunk/general/g.region/printwindow.c	2010-04-13 08:42:00 UTC (rev 41833)
+++ grass/trunk/general/g.region/printwindow.c	2010-04-13 09:29:34 UTC (rev 41834)
@@ -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