From b3f051b46446e2c1211798b99c3375b73a75ae6f Mon Sep 17 00:00:00 2001 From: "Jason T. Brown" Date: Mon, 21 Dec 2020 13:00:41 -0500 Subject: [PATCH] Compiles with GeoMesa 3.1.0 --- .../rasterframes/expressions/transformers/Z2Indexer.scala | 2 +- .../rasterframes/extensions/LayerSpatialColumnMethods.scala | 2 +- .../scala/org/locationtech/rasterframes/SpatialKeySpec.scala | 2 +- .../rasterframes/expressions/SFCIndexerSpec.scala | 4 ++-- project/RFDependenciesPlugin.scala | 4 +++- 5 files changed, 8 insertions(+), 6 deletions(-) diff --git a/core/src/main/scala/org/locationtech/rasterframes/expressions/transformers/Z2Indexer.scala b/core/src/main/scala/org/locationtech/rasterframes/expressions/transformers/Z2Indexer.scala index e6c1c428b..cffc0e120 100644 --- a/core/src/main/scala/org/locationtech/rasterframes/expressions/transformers/Z2Indexer.scala +++ b/core/src/main/scala/org/locationtech/rasterframes/expressions/transformers/Z2Indexer.scala @@ -80,7 +80,7 @@ case class Z2Indexer(left: Expression, right: Expression, indexResolution: Short trans(coord) } - indexer.index(pt.getX, pt.getY, lenient = false).z + indexer.index(pt.getX, pt.getY, lenient = false) } } diff --git a/core/src/main/scala/org/locationtech/rasterframes/extensions/LayerSpatialColumnMethods.scala b/core/src/main/scala/org/locationtech/rasterframes/extensions/LayerSpatialColumnMethods.scala index 2cc58d5ac..fdbb55d31 100644 --- a/core/src/main/scala/org/locationtech/rasterframes/extensions/LayerSpatialColumnMethods.scala +++ b/core/src/main/scala/org/locationtech/rasterframes/extensions/LayerSpatialColumnMethods.scala @@ -121,7 +121,7 @@ trait LayerSpatialColumnMethods extends MethodExtensions[RasterFrameLayer] with * @return RasterFrameLayer with index column. */ def withSpatialIndex(colName: String = SPATIAL_INDEX_COLUMN.columnName, applyOrdering: Boolean = true): RasterFrameLayer = { - val zindex = sparkUdf(keyCol2LatLng andThen (p ⇒ Z2SFC.index(p._1, p._2).z)) + val zindex = sparkUdf(keyCol2LatLng andThen (p ⇒ Z2SFC.index(p._1, p._2))) self.withColumn(colName, zindex(self.spatialKeyColumn)) match { case rf if applyOrdering ⇒ rf.orderBy(asc(colName)).certify case rf ⇒ rf.certify diff --git a/core/src/test/scala/org/locationtech/rasterframes/SpatialKeySpec.scala b/core/src/test/scala/org/locationtech/rasterframes/SpatialKeySpec.scala index 21fc7c886..cd38d7791 100644 --- a/core/src/test/scala/org/locationtech/rasterframes/SpatialKeySpec.scala +++ b/core/src/test/scala/org/locationtech/rasterframes/SpatialKeySpec.scala @@ -60,7 +60,7 @@ class SpatialKeySpec extends TestEnvironment with TestData { it("should add a z-index value") { val center = raster.extent.center.reproject(raster.crs, LatLng) - val expected = Z2SFC.index(center.x, center.y).z + val expected = Z2SFC.index(center.x, center.y) val result = rf.withSpatialIndex().select($"spatial_index".as[Long]).first assert(result === expected) } diff --git a/core/src/test/scala/org/locationtech/rasterframes/expressions/SFCIndexerSpec.scala b/core/src/test/scala/org/locationtech/rasterframes/expressions/SFCIndexerSpec.scala index 965cebd9f..ae15d0850 100644 --- a/core/src/test/scala/org/locationtech/rasterframes/expressions/SFCIndexerSpec.scala +++ b/core/src/test/scala/org/locationtech/rasterframes/expressions/SFCIndexerSpec.scala @@ -55,7 +55,7 @@ class SFCIndexerSpec extends TestEnvironment with Inspectors { val xzExpected = testExtents.map(e => xzsfc.index(e.xmin, e.ymin, e.xmax, e.ymax)) val zExpected = (crs: CRS) => testExtents.map(reproject(crs)).map(e => { val p = e.center.reproject(crs, LatLng) - zsfc.index(p.x, p.y).z + zsfc.index(p.x, p.y) }) describe("Centroid extraction") { @@ -208,7 +208,7 @@ class SFCIndexerSpec extends TestEnvironment with Inspectors { } withClue("Z2") { val sfc = new Z2SFC(3) - val expected = testExtents.map(e => sfc.index(e.center.x, e.center.y).z) + val expected = testExtents.map(e => sfc.index(e.center.x, e.center.y)) val indexes = df.select(rf_z2_index($"extent", serialized_literal(crs), 3)).collect() forEvery(indexes.zip(expected)) { case (i, e) => i should be(e) diff --git a/project/RFDependenciesPlugin.scala b/project/RFDependenciesPlugin.scala index 1130afd58..d6c5dcdcd 100644 --- a/project/RFDependenciesPlugin.scala +++ b/project/RFDependenciesPlugin.scala @@ -75,6 +75,8 @@ object RFDependenciesPlugin extends AutoPlugin { // NB: Make sure to update the Spark version in pyrasterframes/python/setup.py rfSparkVersion := "2.4.7", rfGeoTrellisVersion := "3.3.0", - rfGeoMesaVersion := "2.2.1" +// rfGeoMesaVersion := "2.2.1" + rfGeoMesaVersion := "3.1.0" + // rfGeoMesaVersion := "3.2.0-SNAPSHOT" ) }