Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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") {
Expand Down Expand Up @@ -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)
Expand Down
4 changes: 3 additions & 1 deletion project/RFDependenciesPlugin.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)
}