Browse Source

add masking option

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@43481 15284696-431f-4ddb-bdfa-cd5b030d7da7
Markus Metz 14 years ago
parent
commit
a139427d59
3 changed files with 8 additions and 2 deletions
  1. 1 0
      lib/lidar/lidar.h
  2. 7 1
      lib/lidar/raster.c
  3. 0 1
      lib/lidar/zones.c

+ 1 - 0
lib/lidar/lidar.h

@@ -143,6 +143,7 @@ double **P_Regular_Points(struct Cell_head *, /**/
 			  struct bound_box, /**/
 			  struct bound_box, /**/
 			  struct bound_box, /**/
 			  struct bound_box, /**/
 			  double **, /**/
 			  double **, /**/
+			  char **, /**/
 			  double *, /**/
 			  double *, /**/
 			  double, /**/
 			  double, /**/
 			  double, /**/
 			  double, /**/

+ 7 - 1
lib/lidar/raster.c

@@ -189,7 +189,7 @@ P_Sparse_Points(struct Map_info *Out, struct Cell_head *Elaboration,
 /*------------------------------------------------------------------------------------------------*/
 /*------------------------------------------------------------------------------------------------*/
 double **P_Regular_Points(struct Cell_head *Elaboration, struct Cell_head *Original,
 double **P_Regular_Points(struct Cell_head *Elaboration, struct Cell_head *Original,
                           struct bound_box General, struct bound_box Overlap,
                           struct bound_box General, struct bound_box Overlap,
-			  double **matrix, double *param,
+			  double **matrix, char **mask_matrix, double *param,
 			  double passoN, double passoE, double overlap,
 			  double passoN, double passoE, double overlap,
 			  double mean, int nsplx, int nsply,
 			  double mean, int nsplx, int nsply,
 			  int nrows, int ncols, int bilin)
 			  int nrows, int ncols, int bilin)
@@ -224,6 +224,12 @@ double **P_Regular_Points(struct Cell_head *Elaboration, struct Cell_head *Origi
 
 
     for (row = startrow; row < endrow; row++) {
     for (row = startrow; row < endrow; row++) {
 	for (col = startcol; col < endcol; col++) {
 	for (col = startcol; col < endcol; col++) {
+
+	    if (mask_matrix) {
+		if (!mask_matrix[row][col])
+		    continue;
+	    }
+
 	    X = Rast_col_to_easting((double)(col) + 0.5, Original);
 	    X = Rast_col_to_easting((double)(col) + 0.5, Original);
 	    Y = Rast_row_to_northing((double)(row) + 0.5, Original);
 	    Y = Rast_row_to_northing((double)(row) + 0.5, Original);
 
 

+ 0 - 1
lib/lidar/zones.c

@@ -547,7 +547,6 @@ void P_Aux_to_Raster(double **matrix, int fd)
 {
 {
     int ncols, col, nrows, row;
     int ncols, col, nrows, row;
     void *ptr, *raster;
     void *ptr, *raster;
-    struct Cell_head Original;
 
 
     nrows = Rast_window_rows();
     nrows = Rast_window_rows();
     ncols = Rast_window_cols();
     ncols = Rast_window_cols();