Skip to content

Commit 3a67b6c

Browse files
author
dsamaey
committed
Issue #392 fixed compilation issue
1 parent 49c9450 commit 3a67b6c

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

openeo-geotrellis/src/main/scala/org/openeo/geotrellis/OpenEOProcessScriptBuilder.scala

+10-9
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ package org.openeo.geotrellis
33
import ai.catboost.CatBoostModel
44
import ai.catboost.spark.CatBoostClassificationModel
55
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}
77
import org.apache.commons.math3.exception.NotANumberException
88
import org.apache.commons.math3.stat.descriptive.rank.Percentile
99
import org.apache.commons.math3.stat.descriptive.rank.Percentile.EstimationType
@@ -21,10 +21,11 @@ import java.time.temporal.{ChronoUnit, TemporalAccessor}
2121
import java.time.{Duration, ZonedDateTime}
2222
import java.util
2323
import scala.Double.NaN
24-
import scala.collection.JavaConverters.mapAsScalaMap
24+
import scala.collection.JavaConversions.mapAsScalaMap
2525
import scala.collection.JavaConverters.collectionAsScalaIterableConverter
2626
import scala.collection.mutable.{ArrayBuffer, ListBuffer}
2727
import scala.collection.{immutable, mutable}
28+
import scala.math.BigDecimal
2829
import scala.util.Try
2930
import scala.util.control.Breaks.{break, breakable}
3031

@@ -637,20 +638,20 @@ class OpenEOProcessScriptBuilder {
637638
val data = getProcessArg("data")
638639

639640
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}.")
644645
}
645-
val the_value = value_input.head
646-
val tile = MultibandTile(data_input)
646+
val theValue = valueInput.head
647+
val tile = MultibandTile(dataInput)
647648

648649
val mutableResult:MutableArrayTile = ArrayTile.empty(BitCellType,tile.cols,tile.rows)
649650
for (column <- Range(0, tile.cols)) {
650651
for (row <- Range(0, tile.rows)) {
651652
breakable {
652653
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)) {
654655
mutableResult.set(column, row, 1)
655656
break
656657
}

0 commit comments

Comments
 (0)