[GRASS-SVN] r38139 - grass/branches/develbranch_6/general/g.region
svn_grass at osgeo.org
svn_grass at osgeo.org
Wed Jul 1 07:52:35 EDT 2009
Author: hamish
Date: 2009-07-01 07:52:35 -0400 (Wed, 01 Jul 2009)
New Revision: 38139
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:
New -t flag: Print the current region in GMT style
Modified: grass/branches/develbranch_6/general/g.region/local_proto.h
===================================================================
--- grass/branches/develbranch_6/general/g.region/local_proto.h 2009-07-01 11:42:57 UTC (rev 38138)
+++ grass/branches/develbranch_6/general/g.region/local_proto.h 2009-07-01 11:52:35 UTC (rev 38139)
@@ -10,6 +10,7 @@
#define PRINT_3D 0x40
#define PRINT_MBBOX 0x80
#define PRINT_NANGLE 0x100
+#define PRINT_GMT 0x200
/* 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 2009-07-01 11:42:57 UTC (rev 38138)
+++ grass/branches/develbranch_6/general/g.region/main.c 2009-07-01 11:52:35 UTC (rev 38139)
@@ -46,14 +46,16 @@
{
struct Flag
*update, *print, *gprint, *lprint, *eprint, *nangle,
- *center, *res_set, *dist_res, *dflt, *z, *savedefault, *bbox;
+ *center, *res_set, *dist_res, *dflt, *z, *savedefault,
+ *bbox, *gmt_style;
} flag;
struct
{
struct Option
*north, *south, *east, *west, *top, *bottom,
*res, *nsres, *ewres, *res3, *tbres, *rows, *cols,
- *save, *region, *view, *raster, *raster3d, *align, *zoom, *vect;
+ *save, *region, *view, *raster, *raster3d, *align,
+ *zoom, *vect;
} parm;
G_gisinit(argv[0]);
@@ -103,6 +105,12 @@
_("Print the current region map center coordinates");
flag.center->guisection = _("Print");
+ flag.gmt_style = G_define_flag();
+ flag.gmt_style->key = 't';
+ flag.gmt_style->description =
+ _("Print the current region in GMT style");
+ flag.gmt_style->guisection = _("Print");
+
flag.dist_res = G_define_flag();
flag.dist_res->key = 'm';
flag.dist_res->description =
@@ -370,6 +378,9 @@
if (flag.center->answer)
print_flag |= PRINT_CENTER;
+ if (flag.gmt_style->answer)
+ print_flag |= PRINT_GMT;
+
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 2009-07-01 11:42:57 UTC (rev 38138)
+++ grass/branches/develbranch_6/general/g.region/printwindow.c 2009-07-01 11:52:35 UTC (rev 38139)
@@ -468,6 +468,12 @@
}
}
+
+ /* flag.gmt_style */
+ if (print_flag & PRINT_GMT)
+ fprintf(stdout, "%s/%s/%s/%s\n", west, east, south, north);
+
+
/* flag.nangle */
if (print_flag & PRINT_NANGLE) {
double convergence;
More information about the grass-commit
mailing list