[GRASS-dev] Re: g.region enhacements

Ivan Shmakov ivan at theory.asu.ru
Wed Apr 2 00:21:17 EDT 2008


>>>>> "MS" == Maciej Sieczka <tutey at o2.pl> writes:

 >> What about adding `vect=' and `region=' as well?

 > Talking about g.region vect= - I'd find it very usefull if it honored
 > the 3d vector coordinates too. Currently one has to set top and
 > bottom manually in accordance with his 3d vector.

	Do you mean something like the following?

--- general/g.region/main.c.~2~	2008-04-02 01:11:59.000000000 +0700
+++ general/g.region/main.c	2008-04-02 11:15:40.000000000 +0700
@@ -515,6 +515,8 @@
 			map_window.south = box.S;
 			map_window.west	 = box.W;
 			map_window.east	 = box.E;
+			map_window.top   = box.T;
+			map_window.bottom = box.B;
 
 			if (!first)
 			{
@@ -531,6 +533,10 @@
 					window.east : map_window.east;
 				window.west = (window.west < map_window.west) ?
 					window.west : map_window.west;
+				if (map_window.top > window.top)
+					window.top = map_window.top;
+				if (map_window.bottom < window.bottom)
+					window.bottom = map_window.bottom;
 			}
 
 			if(window.north == window.south)
@@ -543,6 +549,12 @@
 			      window.west = window.west - 0.5 * temp_window.ew_res;
 			      window.east = window.east + 0.5 * temp_window.ew_res;
 			}
+			if (window.top == window.bottom) {
+			      window.bottom = (window.bottom
+					       - 0.5 * temp_window.tb_res);
+			      window.top    = (window.top
+					       + 0.5 * temp_window.tb_res);
+			}
 
 			if(flag.res_set->answer)
 			    G_align_window (&window, &temp_window);



More information about the grass-dev mailing list