Skip to content

Commit 89e2b70

Browse files
committed
Incremental updates to type structure.
1 parent a16ddb4 commit 89e2b70

File tree

10 files changed

+23
-27
lines changed

10 files changed

+23
-27
lines changed

build.sbt

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -70,20 +70,6 @@ lazy val core = project
7070
scaffeine,
7171
scalatest
7272
),
73-
/** https://github.com/lucidworks/spark-solr/issues/179
74-
* Thanks @pomadchin for the tip! */
75-
dependencyOverrides ++= {
76-
val deps = Seq(
77-
"com.fasterxml.jackson.core" % "jackson-core" % "2.6.7",
78-
"com.fasterxml.jackson.core" % "jackson-databind" % "2.6.7",
79-
"com.fasterxml.jackson.core" % "jackson-annotations" % "2.6.7"
80-
)
81-
CrossVersion.partialVersion(scalaVersion.value) match {
82-
// if Scala 2.12+ is used
83-
case Some((2, scalaMajor)) if scalaMajor >= 12 => deps
84-
case _ => deps :+ "com.fasterxml.jackson.module" %% "jackson-module-scala" % "2.6.7"
85-
}
86-
},
8773
buildInfoKeys ++= Seq[BuildInfoKey](
8874
version, scalaVersion, rfGeoTrellisVersion, rfGeoMesaVersion, rfSparkVersion
8975
),

core/src/main/resources/reference.conf

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@ rasterframes {
66
max-truncate-row-element-length = 40
77
raster-source-cache-timeout = 120 seconds
88
}
9-
10-
vlm.gdal {
9+
geotrellis.raster.gdal {
1110
options {
1211
// See https://trac.osgeo.org/gdal/wiki/ConfigOptions for options
1312
//CPL_DEBUG = "OFF"

core/src/main/scala/org/locationtech/rasterframes/ref/ProjectedRasterLike.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ import geotrellis.vector.Extent
3030
*
3131
* @since 11/3/18
3232
*/
33-
trait ProjectedRasterLike extends CellGrid[Int] {
33+
trait ProjectedRasterLike { _: CellGrid[Int] =>
3434
def crs: CRS
3535
def extent: Extent
3636
}

core/src/main/scala/org/locationtech/rasterframes/ref/RFRasterSource.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ import scala.concurrent.duration.Duration
4444
* @since 8/21/18
4545
*/
4646
@Experimental
47-
trait RFRasterSource extends ProjectedRasterLike with Serializable {
47+
abstract class RFRasterSource extends CellGrid[Int] with ProjectedRasterLike with Serializable {
4848
import RFRasterSource._
4949

5050
def crs: CRS

core/src/main/scala/org/locationtech/rasterframes/ref/RasterRef.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ package org.locationtech.rasterframes.ref
2323

2424
import com.typesafe.scalalogging.LazyLogging
2525
import geotrellis.proj4.CRS
26-
import geotrellis.raster.{CellType, GridBounds, Tile}
26+
import geotrellis.raster.{CellGrid, CellType, GridBounds, Tile}
2727
import geotrellis.vector.{Extent, ProjectedExtent}
2828
import org.apache.spark.sql.catalyst.encoders.ExpressionEncoder
2929
import org.apache.spark.sql.rf.RasterSourceUDT
@@ -39,7 +39,7 @@ import org.locationtech.rasterframes.tiles.ProjectedRasterTile
3939
* @since 8/21/18
4040
*/
4141
case class RasterRef(source: RFRasterSource, bandIndex: Int, subextent: Option[Extent], subgrid: Option[GridBounds[Int]])
42-
extends ProjectedRasterLike {
42+
extends CellGrid[Int] with ProjectedRasterLike {
4343
def crs: CRS = source.crs
4444
def extent: Extent = subextent.getOrElse(source.extent)
4545
def projectedExtent: ProjectedExtent = ProjectedExtent(extent, crs)

core/src/main/scala/org/locationtech/rasterframes/tiles/FixedDelegatingTile.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ import geotrellis.raster.{ArrayTile, DelegatingTile, Tile}
2626
* Workaround for case where `combine` is invoked on two delegating tiles.
2727
* @since 8/22/18
2828
*/
29-
trait FixedDelegatingTile extends DelegatingTile {
29+
abstract class FixedDelegatingTile extends DelegatingTile {
3030
override def combine(r2: Tile)(f: (Int, Int) Int): Tile = (delegate, r2) match {
3131
case (del: ArrayTile, r2: DelegatingTile) del.combine(r2.toArrayTile())(f)
3232
case _ delegate.combine(r2)(f)

core/src/main/scala/org/locationtech/rasterframes/tiles/ProjectedRasterTile.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ import org.locationtech.rasterframes.ref.RasterRef.RasterRefTile
4040
*
4141
* @since 9/5/18
4242
*/
43-
trait ProjectedRasterTile extends FixedDelegatingTile with ProjectedRasterLike {
43+
abstract class ProjectedRasterTile extends FixedDelegatingTile with ProjectedRasterLike {
4444
def extent: Extent
4545
def crs: CRS
4646
def projectedExtent: ProjectedExtent = ProjectedExtent(extent, crs)

core/src/test/scala/org/locationtech/rasterframes/RasterJoinSpec.scala

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ package org.locationtech.rasterframes
2424
import geotrellis.raster.resample.Bilinear
2525
import geotrellis.raster.testkit.RasterMatchers
2626
import geotrellis.raster.{IntConstantNoDataCellType, Raster, Tile}
27-
import geotrellis.vector.Extent
2827
import org.apache.spark.SparkConf
2928
import org.apache.spark.sql.functions._
3029
import org.locationtech.rasterframes.expressions.aggregates.TileRasterizerAggregate
@@ -158,8 +157,6 @@ class RasterJoinSpec extends TestEnvironment with TestData with RasterMatchers {
158157

159158
total18 should be > 0.0
160159
total18 should be < total17
161-
162-
163160
}
164161

165162
it("should pass through ancillary columns") {

datasource/src/test/scala/org/locationtech/rasterframes/datasource/geotiff/GeoTiffDataSourceSpec.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ package org.locationtech.rasterframes.datasource.geotiff
2323
import java.nio.file.{Path, Paths}
2424

2525
import geotrellis.proj4._
26-
import geotrellis.raster.CellType
26+
import geotrellis.raster.{CellType, Dimensions}
2727
import geotrellis.raster.io.geotiff.{MultibandGeoTiff, SinglebandGeoTiff}
2828
import geotrellis.vector.Extent
2929
import org.locationtech.rasterframes._
@@ -93,7 +93,7 @@ class GeoTiffDataSourceSpec
9393

9494
def checkTiff(file: Path, cols: Int, rows: Int, extent: Extent, cellType: Option[CellType] = None) = {
9595
val outputTif = SinglebandGeoTiff(file.toString)
96-
outputTif.tile.dimensions should be ((cols, rows))
96+
outputTif.tile.dimensions should be (Dimensions(cols, rows))
9797
outputTif.extent should be (extent)
9898
cellType.foreach(ct =>
9999
outputTif.cellType should be (ct)

project/RFDependenciesPlugin.scala

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,20 @@ object RFDependenciesPlugin extends AutoPlugin {
5757
"Open Source Geospatial Foundation Repository" at "http://download.osgeo.org/webdav/geotools/"
5858
),
5959

60+
/** https://github.com/lucidworks/spark-solr/issues/179
61+
* Thanks @pomadchin for the tip! */
62+
dependencyOverrides ++= {
63+
val deps = Seq(
64+
"com.fasterxml.jackson.core" % "jackson-core" % "2.6.7",
65+
"com.fasterxml.jackson.core" % "jackson-databind" % "2.6.7",
66+
"com.fasterxml.jackson.core" % "jackson-annotations" % "2.6.7"
67+
)
68+
CrossVersion.partialVersion(scalaVersion.value) match {
69+
// if Scala 2.12+ is used
70+
case Some((2, scalaMajor)) if scalaMajor >= 12 => deps
71+
case _ => deps :+ "com.fasterxml.jackson.module" %% "jackson-module-scala" % "2.6.7"
72+
}
73+
},
6074
// NB: Make sure to update the Spark version in pyrasterframes/python/setup.py
6175
rfSparkVersion := "2.4.4",
6276
rfGeoTrellisVersion := "3.0.0",

0 commit comments

Comments
 (0)