Skip to content

Commit f466e38

Browse files
committed
Merge remote-tracking branch 'locationtech/develop' into feature/tile-quantile
2 parents df11ac1 + 8b948fc commit f466e38

11 files changed

Lines changed: 492 additions & 383 deletions

File tree

.circleci/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ _defaults: &defaults
55
environment:
66
TERM: dumb
77
docker:
8-
- image: s22s/rasterframes-circleci:latest
8+
- image: s22s/rasterframes-circleci:9b7682ef
99

1010
_setenv: &setenv
1111
name: set CloudRepo credentials

build/circleci/Dockerfile

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ FROM circleci/openjdk:8-jdk
22

33
ENV OPENJPEG_VERSION 2.3.1
44
ENV GDAL_VERSION 2.4.1
5+
ENV SPATIALINDEX_VERSION 1.9.3
56
ENV JAVA_HOME /usr/lib/jvm/java-8-openjdk-amd64/
67

78
# most of these libraries required for
@@ -74,3 +75,15 @@ RUN \
7475
sudo make install && \
7576
sudo ldconfig && \
7677
cd /tmp && sudo rm -Rf gdal*
78+
79+
# Compile and install libspatialindex
80+
RUN \
81+
cd /tmp && \
82+
wget https://github.com/libspatialindex/libspatialindex/releases/download/${SPATIALINDEX_VERSION}/spatialindex-src-${SPATIALINDEX_VERSION}.tar.gz && \
83+
tar -xf spatialindex-src-${SPATIALINDEX_VERSION}.tar.gz && \
84+
cd spatialindex-src-${SPATIALINDEX_VERSION}/ && \
85+
cmake -DCMAKE_INSTALL_PREFIX=/usr/local/ && \
86+
make && \
87+
sudo make install && \
88+
sudo ldconfig && \
89+
cd /tmp && sudo rm -Rf spatialindex*

core/src/main/scala/org/locationtech/rasterframes/expressions/transformers/Mask.scala

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ package org.locationtech.rasterframes.expressions.transformers
2323

2424
import com.typesafe.scalalogging.Logger
2525
import geotrellis.raster
26-
import geotrellis.raster.Tile
26+
import geotrellis.raster.{NoNoData, Tile}
2727
import geotrellis.raster.mapalgebra.local.{Undefined, InverseMask gtInverseMask, Mask gtMask}
2828
import org.apache.spark.sql.catalyst.analysis.TypeCheckResult
2929
import org.apache.spark.sql.catalyst.analysis.TypeCheckResult.{TypeCheckFailure, TypeCheckSuccess}
@@ -73,6 +73,10 @@ abstract class Mask(val left: Expression, val middle: Expression, val right: Exp
7373
override protected def nullSafeEval(targetInput: Any, maskInput: Any, maskValueInput: Any): Any = {
7474
implicit val tileSer = TileUDT.tileSerializer
7575
val (targetTile, targetCtx) = tileExtractor(targetExp.dataType)(row(targetInput))
76+
77+
require(! targetTile.cellType.isInstanceOf[NoNoData],
78+
s"Input data expression ${left.prettyName} must have a CellType with NoData defined in order to perform a masking operation. Found CellType ${targetTile.cellType.toString()}.")
79+
7680
val (maskTile, maskCtx) = tileExtractor(maskExp.dataType)(row(maskInput))
7781

7882
if (targetCtx.isEmpty && maskCtx.isDefined)

0 commit comments

Comments
 (0)