[GRASS-SVN] r59133 - grass/trunk/lib/imagery

svn_grass at osgeo.org svn_grass at osgeo.org
Mon Feb 24 02:28:01 PST 2014


Author: turek
Date: 2014-02-24 02:28:01 -0800 (Mon, 24 Feb 2014)
New Revision: 59133

Modified:
   grass/trunk/lib/imagery/iclass_perimeter.c
   grass/trunk/lib/imagery/iscatt_core.c
Log:
wx.iscatt: make it work in latlong locations

Modified: grass/trunk/lib/imagery/iclass_perimeter.c
===================================================================
--- grass/trunk/lib/imagery/iclass_perimeter.c	2014-02-24 10:14:25 UTC (rev 59132)
+++ grass/trunk/lib/imagery/iclass_perimeter.c	2014-02-24 10:28:01 UTC (rev 59133)
@@ -176,10 +176,22 @@
     for (i = 0; i < count; i++) {
 	G_debug(5, "iclass_make_perimeter(): points: x: %f y: %f",
 		points->x[i], points->y[i]);
-	tmp_points[i].y = Rast_northing_to_row(points->y[i], band_region);
-	tmp_points[i].x = Rast_easting_to_col(points->x[i], band_region);
-    }
 
+    /* This functions are no longer used because of the different behaviour 
+       of Rast_easting_to_col depending whether location is LL or not. 
+       It makes problem  in  interactive scatter plot tool, 
+       which defines its own coordinates systems for the plots and 
+       therefore it requires the function to work always in same way 
+       without hidden dependency on location type.
+
+	  tmp_points[i].y = Rast_northing_to_row(points->y[i], band_region);
+	  tmp_points[i].x = Rast_easting_to_col(points->x[i], band_region);
+   */
+
+   tmp_points[i].y = (band_region->north - points->y[i]) / band_region->ns_res;
+   tmp_points[i].x = (points->x[i] - band_region->west) / band_region->ew_res;
+    }   
+
     /* find first edge which is not horizontal */
 
     first = -1;

Modified: grass/trunk/lib/imagery/iscatt_core.c
===================================================================
--- grass/trunk/lib/imagery/iscatt_core.c	2014-02-24 10:14:25 UTC (rev 59132)
+++ grass/trunk/lib/imagery/iscatt_core.c	2014-02-24 10:28:01 UTC (rev 59133)
@@ -962,7 +962,7 @@
 	Vect_append_point(pol, polygon[i * 2], polygon[i * 2 + 1], 0.0);
     }
 
-    Rast_set_window(rast_region);
+    //Rast_set_window(rast_region);
 
     make_perimeter(pol, &perimeter, rast_region);
     for (i = 1; i < perimeter.npoints; i += 2) {



More information about the grass-commit mailing list