File tree Expand file tree Collapse file tree 5 files changed +15
-9
lines changed
core/src/main/scala/org/locationtech/rasterframes/expressions/aggregates Expand file tree Collapse file tree 5 files changed +15
-9
lines changed Original file line number Diff line number Diff line change @@ -123,8 +123,8 @@ object CellStatsAggregate {
123123 import org .locationtech .rasterframes .encoders .StandardEncoders .cellStatsEncoder
124124
125125 def apply (col : Column ): TypedColumn [Any , CellStatistics ] =
126- new Column ( new CellStatsAggregateUDAF ( col.expr ))
127- .as(s " rf_agg_stats( $col) " ) // node renaming in class doesn't seem to propagate
126+ new CellStatsAggregate ()( ExtractTile ( col))
127+ .as(s " rf_agg_stats( $col) " )
128128 .as[CellStatistics ]
129129
130130 /** Adapter hack to allow UserDefinedAggregateFunction to be referenced as an expression. */
Original file line number Diff line number Diff line change @@ -98,8 +98,8 @@ object HistogramAggregate {
9898 import org .locationtech .rasterframes .encoders .StandardEncoders .cellHistEncoder
9999
100100 def apply (col : Column ): TypedColumn [Any , CellHistogram ] =
101- new Column ( new HistogramAggregateUDAF ( col.expr ))
102- .as(s " rf_agg_approx_histogram( $col) " ) // node renaming in class doesn't seem to propogate
101+ new HistogramAggregate ()( ExtractTile ( col))
102+ .as(s " rf_agg_approx_histogram( $col) " )
103103 .as[CellHistogram ]
104104
105105 /** Adapter hack to allow UserDefinedAggregateFunction to be referenced as an expression. */
Original file line number Diff line number Diff line change @@ -92,7 +92,7 @@ object LocalCountAggregate {
9292 object LocalDataCellsUDAF {
9393 def apply (child : Expression ): LocalDataCellsUDAF = new LocalDataCellsUDAF (child)
9494 def apply (tile : Column ): TypedColumn [Any , Tile ] =
95- new Column ( new LocalDataCellsUDAF ( tile.expr ))
95+ new LocalCountAggregate ( true )( ExtractTile ( tile))
9696 .as(s " rf_agg_local_data_cells( $tile) " )
9797 .as[Tile ]
9898 }
@@ -107,7 +107,7 @@ object LocalCountAggregate {
107107 object LocalNoDataCellsUDAF {
108108 def apply (child : Expression ): LocalNoDataCellsUDAF = new LocalNoDataCellsUDAF (child)
109109 def apply (tile : Column ): TypedColumn [Any , Tile ] =
110- new Column ( new LocalNoDataCellsUDAF ( tile.expr ))
110+ new LocalCountAggregate ( false )( ExtractTile ( tile))
111111 .as(s " rf_agg_local_no_data_cells( $tile) " )
112112 .as[Tile ]
113113 }
Original file line number Diff line number Diff line change @@ -146,7 +146,7 @@ class LocalStatsAggregate() extends UserDefinedAggregateFunction {
146146object LocalStatsAggregate {
147147
148148 def apply (col : Column ): TypedColumn [Any , LocalCellStatistics ] =
149- new Column ( LocalStatsAggregateUDAF ( col.expr ))
149+ new LocalStatsAggregate ()( ExtractTile ( col))
150150 .as(s " rf_agg_local_stats( $col) " )
151151 .as[LocalCellStatistics ]
152152
Original file line number Diff line number Diff line change @@ -83,7 +83,10 @@ object LocalTileOpAggregate {
8383 }
8484 object LocalMinUDAF {
8585 def apply (child : Expression ): LocalMinUDAF = new LocalMinUDAF (child)
86- def apply (tile : Column ): TypedColumn [Any , Tile ] = new Column (new LocalMinUDAF (tile.expr)).as[Tile ]
86+ def apply (tile : Column ): TypedColumn [Any , Tile ] =
87+ new LocalTileOpAggregate (BiasedMin )(ExtractTile (tile))
88+ .as(s " rf_agg_local_min( $tile) " )
89+ .as[Tile ]
8790 }
8891
8992 @ ExpressionDescription (
@@ -95,6 +98,9 @@ object LocalTileOpAggregate {
9598 }
9699 object LocalMaxUDAF {
97100 def apply (child : Expression ): LocalMaxUDAF = new LocalMaxUDAF (child)
98- def apply (tile : Column ): TypedColumn [Any , Tile ] = new Column (new LocalMaxUDAF (tile.expr)).as[Tile ]
101+ def apply (tile : Column ): TypedColumn [Any , Tile ] =
102+ new LocalTileOpAggregate (BiasedMax )(ExtractTile (tile))
103+ .as(s " rf_agg_local_max( $tile) " )
104+ .as[Tile ]
99105 }
100106}
You can’t perform that action at this time.
0 commit comments