@@ -73,8 +73,8 @@ trait RasterFunctions {
7373
7474 @ Experimental
7575 /** Convert array in `arrayCol` into a Tile of dimensions `cols` and `rows`*/
76- def rf_array_to_tile (arrayCol : Column , cols : Int , rows : Int ) = withAlias (" rf_array_to_tile" , arrayCol )(
77- udf[Tile , AnyRef ](F .arrayToTile(cols, rows)).apply(arrayCol)
76+ def rf_array_to_tile (arrayCol : Column , cols : Int , rows : Int ): TypedColumn [ Any , Tile ] = withTypedAlias (" rf_array_to_tile" )(
77+ udf[Tile , AnyRef ](F .arrayToTile(cols, rows)).apply(arrayCol).as[ Tile ]
7878 )
7979
8080 /** Create a Tile from a column of cell data with location indexes and preform cell conversion. */
@@ -89,12 +89,10 @@ trait RasterFunctions {
8989 def rf_cell_type (col : Column ): TypedColumn [Any , CellType ] = GetCellType (col)
9090
9191 /** Change the Tile's cell type */
92- def rf_convert_cell_type (col : Column , cellType : CellType ): TypedColumn [Any , Tile ] =
93- SetCellType (col, cellType)
92+ def rf_convert_cell_type (col : Column , cellType : CellType ): Column = SetCellType (col, cellType)
9493
9594 /** Change the Tile's cell type */
96- def rf_convert_cell_type (col : Column , cellTypeName : String ): TypedColumn [Any , Tile ] =
97- SetCellType (col, cellTypeName)
95+ def rf_convert_cell_type (col : Column , cellTypeName : String ): Column = SetCellType (col, cellTypeName)
9896
9997 /** Resample tile to different size based on scalar factor or tile whose dimension to match. Scalar less
10098 * than one will downsample tile; greater than one will upsample. Uses nearest-neighbor. */
@@ -110,18 +108,20 @@ trait RasterFunctions {
110108 /** Extract the extent of a RasterSource or ProjectedRasterTile as a Geometry type. */
111109 def rf_geometry (raster : Column ): TypedColumn [Any , Geometry ] = GetGeometry (raster)
112110
113- /** Assign a `NoData` value to the Tiles. */
114- def rf_with_no_data (col : Column , nodata : Double ): TypedColumn [Any , Tile ] = withTypedAlias(" rf_with_no_data" , col)(
115- udf[Tile , Tile ](F .withNoData(nodata)).apply(col)
116- )
111+ /** Assign a `NoData` value to the tile column. */
112+ def rf_with_no_data (col : Column , nodata : Double ): Column = SetNoDataValue (col, nodata)
113+
114+ /** Assign a `NoData` value to the tile column. */
115+ def rf_with_no_data (col : Column , nodata : Int ): Column = SetNoDataValue (col, nodata)
116+
117+ /** Assign a `NoData` value to the tile column. */
118+ def rf_with_no_data (col : Column , nodata : Column ): Column = SetNoDataValue (col, nodata)
117119
118120 /** Compute the full column aggregate floating point histogram. */
119- def rf_agg_approx_histogram (col : Column ): TypedColumn [Any , CellHistogram ] =
120- HistogramAggregate (col)
121+ def rf_agg_approx_histogram (col : Column ): TypedColumn [Any , CellHistogram ] = HistogramAggregate (col)
121122
122123 /** Compute the full column aggregate floating point statistics. */
123- def rf_agg_stats (col : Column ): TypedColumn [Any , CellStatistics ] =
124- CellStatsAggregate (col)
124+ def rf_agg_stats (col : Column ): TypedColumn [Any , CellStatistics ] = CellStatsAggregate (col)
125125
126126 /** Computes the column aggregate mean. */
127127 def rf_agg_mean (col : Column ) = CellMeanAggregate (col)
@@ -194,28 +194,28 @@ trait RasterFunctions {
194194 def rf_agg_local_no_data_cells (col : Column ): TypedColumn [Any , Tile ] = LocalCountAggregate .LocalNoDataCellsUDAF (col)
195195
196196 /** Cellwise addition between two Tiles or Tile and scalar column. */
197- def rf_local_add (left : Column , right : Column ): TypedColumn [ Any , Tile ] = Add (left, right)
197+ def rf_local_add (left : Column , right : Column ): Column = Add (left, right)
198198
199199 /** Cellwise addition of a scalar value to a tile. */
200- def rf_local_add [T : Numeric ](tileCol : Column , value : T ): TypedColumn [ Any , Tile ] = Add (tileCol, value)
200+ def rf_local_add [T : Numeric ](tileCol : Column , value : T ): Column = Add (tileCol, value)
201201
202202 /** Cellwise subtraction between two Tiles. */
203- def rf_local_subtract (left : Column , right : Column ): TypedColumn [ Any , Tile ] = Subtract (left, right)
203+ def rf_local_subtract (left : Column , right : Column ): Column = Subtract (left, right)
204204
205205 /** Cellwise subtraction of a scalar value from a tile. */
206- def rf_local_subtract [T : Numeric ](tileCol : Column , value : T ): TypedColumn [ Any , Tile ] = Subtract (tileCol, value)
206+ def rf_local_subtract [T : Numeric ](tileCol : Column , value : T ): Column = Subtract (tileCol, value)
207207
208208 /** Cellwise multiplication between two Tiles. */
209- def rf_local_multiply (left : Column , right : Column ): TypedColumn [ Any , Tile ] = Multiply (left, right)
209+ def rf_local_multiply (left : Column , right : Column ): Column = Multiply (left, right)
210210
211211 /** Cellwise multiplication of a tile by a scalar value. */
212- def rf_local_multiply [T : Numeric ](tileCol : Column , value : T ): TypedColumn [ Any , Tile ] = Multiply (tileCol, value)
212+ def rf_local_multiply [T : Numeric ](tileCol : Column , value : T ): Column = Multiply (tileCol, value)
213213
214214 /** Cellwise division between two Tiles. */
215- def rf_local_divide (left : Column , right : Column ): TypedColumn [ Any , Tile ] = Divide (left, right)
215+ def rf_local_divide (left : Column , right : Column ): Column = Divide (left, right)
216216
217217 /** Cellwise division of a tile by a scalar value. */
218- def rf_local_divide [T : Numeric ](tileCol : Column , value : T ): TypedColumn [ Any , Tile ] = Divide (tileCol, value)
218+ def rf_local_divide [T : Numeric ](tileCol : Column , value : T ): Column = Divide (tileCol, value)
219219
220220 /** Perform an arbitrary GeoTrellis `LocalTileBinaryOp` between two Tile columns. */
221221 def rf_local_algebra (op : LocalTileBinaryOp , left : Column , right : Column ): TypedColumn [Any , Tile ] =
@@ -326,96 +326,72 @@ trait RasterFunctions {
326326 DebugRender .RenderMatrix (col)
327327
328328 /** Cellwise less than value comparison between two tiles. */
329- def rf_local_less (left : Column , right : Column ): TypedColumn [Any , Tile ] =
330- Less (left, right)
329+ def rf_local_less (left : Column , right : Column ): Column = Less (left, right)
331330
332331 /** Cellwise less than value comparison between a tile and a scalar. */
333- def rf_local_less [T : Numeric ](tileCol : Column , value : T ): TypedColumn [Any , Tile ] =
334- Less (tileCol, value)
332+ def rf_local_less [T : Numeric ](tileCol : Column , value : T ): Column = Less (tileCol, value)
335333
336334 /** Cellwise less than or equal to value comparison between a tile and a scalar. */
337- def rf_local_less_equal (left : Column , right : Column ): TypedColumn [Any , Tile ] =
338- LessEqual (left, right)
335+ def rf_local_less_equal (left : Column , right : Column ): Column = LessEqual (left, right)
339336
340337 /** Cellwise less than or equal to value comparison between a tile and a scalar. */
341- def rf_local_less_equal [T : Numeric ](tileCol : Column , value : T ): TypedColumn [Any , Tile ] =
342- LessEqual (tileCol, value)
338+ def rf_local_less_equal [T : Numeric ](tileCol : Column , value : T ): Column = LessEqual (tileCol, value)
343339
344340 /** Cellwise greater than value comparison between two tiles. */
345- def rf_local_greater (left : Column , right : Column ): TypedColumn [Any , Tile ] =
346- Greater (left, right)
341+ def rf_local_greater (left : Column , right : Column ): Column = Greater (left, right)
347342
348343 /** Cellwise greater than value comparison between a tile and a scalar. */
349- def rf_local_greater [T : Numeric ](tileCol : Column , value : T ): TypedColumn [Any , Tile ] =
350- Greater (tileCol, value)
351-
344+ def rf_local_greater [T : Numeric ](tileCol : Column , value : T ): Column = Greater (tileCol, value)
352345 /** Cellwise greater than or equal to value comparison between two tiles. */
353- def rf_local_greater_equal (left : Column , right : Column ): TypedColumn [Any , Tile ] =
354- GreaterEqual (left, right)
346+ def rf_local_greater_equal (left : Column , right : Column ): Column = GreaterEqual (left, right)
355347
356348 /** Cellwise greater than or equal to value comparison between a tile and a scalar. */
357- def rf_local_greater_equal [T : Numeric ](tileCol : Column , value : T ): TypedColumn [Any , Tile ] =
358- GreaterEqual (tileCol, value)
349+ def rf_local_greater_equal [T : Numeric ](tileCol : Column , value : T ): Column = GreaterEqual (tileCol, value)
359350
360351 /** Cellwise equal to value comparison between two tiles. */
361- def rf_local_equal (left : Column , right : Column ): TypedColumn [Any , Tile ] =
362- Equal (left, right)
352+ def rf_local_equal (left : Column , right : Column ): Column = Equal (left, right)
363353
364354 /** Cellwise equal to value comparison between a tile and a scalar. */
365- def rf_local_equal [T : Numeric ](tileCol : Column , value : T ): TypedColumn [Any , Tile ] =
366- Equal (tileCol, value)
355+ def rf_local_equal [T : Numeric ](tileCol : Column , value : T ): Column = Equal (tileCol, value)
367356
368357 /** Cellwise inequality comparison between two tiles. */
369- def rf_local_unequal (left : Column , right : Column ): TypedColumn [Any , Tile ] =
370- Unequal (left, right)
358+ def rf_local_unequal (left : Column , right : Column ): Column = Unequal (left, right)
371359
372360 /** Cellwise inequality comparison between a tile and a scalar. */
373- def rf_local_unequal [T : Numeric ](tileCol : Column , value : T ): TypedColumn [Any , Tile ] =
374- Unequal (tileCol, value)
361+ def rf_local_unequal [T : Numeric ](tileCol : Column , value : T ): Column = Unequal (tileCol, value)
375362
376363 /** Round cell values to nearest integer without chaning cell type. */
377- def rf_round (tileCol : Column ): TypedColumn [Any , Tile ] =
378- Round (tileCol)
364+ def rf_round (tileCol : Column ): Column = Round (tileCol)
379365
380366 /** Compute the absolute value of each cell. */
381- def rf_abs (tileCol : Column ): TypedColumn [Any , Tile ] =
382- Abs (tileCol)
367+ def rf_abs (tileCol : Column ): Column = Abs (tileCol)
383368
384369 /** Take natural logarithm of cell values. */
385- def rf_log (tileCol : Column ): TypedColumn [Any , Tile ] =
386- Log (tileCol)
370+ def rf_log (tileCol : Column ): Column = Log (tileCol)
387371
388372 /** Take base 10 logarithm of cell values. */
389- def rf_log10 (tileCol : Column ): TypedColumn [Any , Tile ] =
390- Log10 (tileCol)
373+ def rf_log10 (tileCol : Column ): Column = Log10 (tileCol)
391374
392375 /** Take base 2 logarithm of cell values. */
393- def rf_log2 (tileCol : Column ): TypedColumn [Any , Tile ] =
394- Log2 (tileCol)
376+ def rf_log2 (tileCol : Column ): Column = Log2 (tileCol)
395377
396378 /** Natural logarithm of one plus cell values. */
397- def rf_log1p (tileCol : Column ): TypedColumn [Any , Tile ] =
398- Log1p (tileCol)
379+ def rf_log1p (tileCol : Column ): Column = Log1p (tileCol)
399380
400381 /** Exponential of cell values */
401- def rf_exp (tileCol : Column ): TypedColumn [Any , Tile ] =
402- Exp (tileCol)
382+ def rf_exp (tileCol : Column ): Column = Exp (tileCol)
403383
404384 /** Ten to the power of cell values */
405- def rf_exp10 (tileCol : Column ): TypedColumn [Any , Tile ] =
406- Exp10 (tileCol)
385+ def rf_exp10 (tileCol : Column ): Column = Exp10 (tileCol)
407386
408387 /** Two to the power of cell values */
409- def rf_exp2 (tileCol : Column ): TypedColumn [Any , Tile ] =
410- Exp2 (tileCol)
388+ def rf_exp2 (tileCol : Column ): Column = Exp2 (tileCol)
411389
412390 /** Exponential of cell values, less one*/
413- def rf_expm1 (tileCol : Column ): TypedColumn [Any , Tile ] =
414- ExpM1 (tileCol)
391+ def rf_expm1 (tileCol : Column ): Column = ExpM1 (tileCol)
415392
416393 /** Return the incoming tile untouched. */
417- def rf_identity (tileCol : Column ): TypedColumn [Any , Tile ] =
418- Identity (tileCol)
394+ def rf_identity (tileCol : Column ): Column = Identity (tileCol)
419395
420396 /** Create a row for each cell in Tile. */
421397 def rf_explode_tiles (cols : Column * ): Column = rf_explode_tiles_sample(1.0 , None , cols : _* )
0 commit comments