@@ -3,7 +3,7 @@ package org.openeo.geotrellis
3
3
import ai .catboost .CatBoostModel
4
4
import ai .catboost .spark .CatBoostClassificationModel
5
5
import geotrellis .raster .mapalgebra .local ._
6
- import geotrellis .raster .{ArrayTile , BitCellType , BitConstantTile , ByteUserDefinedNoDataCellType , CellType , ConstantTile , Dimensions , DoubleConstantNoDataCellType , DoubleConstantTile , FloatConstantNoDataCellType , FloatConstantTile , IntConstantNoDataCellType , IntConstantTile , MultibandTile , MutableArrayTile , NODATA , ShortConstantNoDataCellType , ShortConstantTile , Tile , UByteCells , UByteConstantTile , UByteUserDefinedNoDataCellType , UShortCells , UShortUserDefinedNoDataCellType , isData , isNoData }
6
+ import geotrellis .raster .{ArrayTile , BitCellType , ByteUserDefinedNoDataCellType , CellType , ConstantTile , Dimensions , DoubleConstantNoDataCellType , DoubleConstantTile , FloatConstantNoDataCellType , FloatConstantTile , IntConstantNoDataCellType , IntConstantTile , MultibandTile , MutableArrayTile , NODATA , ShortConstantNoDataCellType , ShortConstantTile , Tile , UByteCells , UByteConstantTile , UByteUserDefinedNoDataCellType , UShortCells , UShortUserDefinedNoDataCellType , isData , isNoData }
7
7
import org .apache .commons .math3 .exception .NotANumberException
8
8
import org .apache .commons .math3 .stat .descriptive .rank .Percentile
9
9
import org .apache .commons .math3 .stat .descriptive .rank .Percentile .EstimationType
@@ -21,10 +21,11 @@ import java.time.temporal.{ChronoUnit, TemporalAccessor}
21
21
import java .time .{Duration , ZonedDateTime }
22
22
import java .util
23
23
import scala .Double .NaN
24
- import scala .collection .JavaConverters .mapAsScalaMap
24
+ import scala .collection .JavaConversions .mapAsScalaMap
25
25
import scala .collection .JavaConverters .collectionAsScalaIterableConverter
26
26
import scala .collection .mutable .{ArrayBuffer , ListBuffer }
27
27
import scala .collection .{immutable , mutable }
28
+ import scala .math .BigDecimal
28
29
import scala .util .Try
29
30
import scala .util .control .Breaks .{break , breakable }
30
31
@@ -637,20 +638,20 @@ class OpenEOProcessScriptBuilder {
637
638
val data = getProcessArg(" data" )
638
639
639
640
val arrayContainsProcess = (context : Map [String , Any ]) => (tiles : Seq [Tile ]) => {
640
- val value_input : Seq [Tile ] = evaluateToTiles(value, context, tiles)
641
- val data_input : Seq [Tile ] = evaluateToTiles(data, context, tiles)
642
- if (value_input .size != 1 ) {
643
- throw new IllegalArgumentException (" The value argument of the array_contains function should resolve to exactly one input." )
641
+ val valueInput : Seq [Tile ] = evaluateToTiles(value, context, tiles)
642
+ val dataInput : Seq [Tile ] = evaluateToTiles(data, context, tiles)
643
+ if (valueInput .size != 1 ) {
644
+ throw new IllegalArgumentException (f " The value argument of the array_contains function should resolve to exactly one input, got ${valueInput.size} . " )
644
645
}
645
- val the_value = value_input .head
646
- val tile = MultibandTile (data_input )
646
+ val theValue = valueInput .head
647
+ val tile = MultibandTile (dataInput )
647
648
648
649
val mutableResult : MutableArrayTile = ArrayTile .empty(BitCellType ,tile.cols,tile.rows)
649
650
for (column <- Range (0 , tile.cols)) {
650
651
for (row <- Range (0 , tile.rows)) {
651
652
breakable {
652
653
for (band <- tile.bands) {
653
- if (band.get(column, row) == the_value .get(column, row)) {
654
+ if (band.get(column, row) == theValue .get(column, row)) {
654
655
mutableResult.set(column, row, 1 )
655
656
break
656
657
}
0 commit comments