Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ETL typos fix #2201

Merged
merged 1 commit into from
May 16, 2017
Merged
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
10 changes: 6 additions & 4 deletions spark-etl/src/main/scala/geotrellis/spark/etl/Etl.scala
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ case class Etl(conf: EtlConf, @transient modules: Seq[TypedModule] = Etl.default
V <: CellGrid: Stitcher: ClassTag: (? => TileMergeMethods[V]): (? => TilePrototypeMethods[V]):
(? => TileReprojectMethods[V]): (? => CropMethods[V]),
K: SpatialComponent: Boundable: ClassTag
](rdd: RDD[(I, V)], method: ResampleMethod = NearestNeighbor)(implicit sc: SparkContext): (Int, RDD[(K, V)] with Metadata[TileLayerMetadata[K]]) = {
](rdd: RDD[(I, V)], method: ResampleMethod = output.resampleMethod)(implicit sc: SparkContext): (Int, RDD[(K, V)] with Metadata[TileLayerMetadata[K]]) = {
val targetCellType = output.cellType
val destCrs = output.getCrs.get

Expand All @@ -153,10 +153,12 @@ case class Etl(conf: EtlConf, @transient modules: Seq[TypedModule] = Etl.default
// rekey metadata to targetLayout
val newSpatialBounds = KeyBounds(targetLayout.mapTransform(floatMD.extent))
val tiledMD = floatMD.copy(
bounds = floatMD.bounds.setSpatialBounds(newSpatialBounds))
bounds = floatMD.bounds.setSpatialBounds(newSpatialBounds),
layout = targetLayout
)

// > 1 means we're upsampling during tiling process
val resolutionRatio = (floatMD.layout.cellSize.resolution / targetLayout.cellSize.resolution)
val resolutionRatio = floatMD.layout.cellSize.resolution / targetLayout.cellSize.resolution
val tilerOptions = Tiler.Options(
resampleMethod = method,
partitioner = new HashPartitioner(
Expand All @@ -175,7 +177,7 @@ case class Etl(conf: EtlConf, @transient modules: Seq[TypedModule] = Etl.default
}

scheme match {
case Left(scheme: ZoomedLayoutScheme) if output.maxZoom.isDefined=>
case Left(scheme: ZoomedLayoutScheme) if output.maxZoom.isDefined =>
val LayoutLevel(zoom, layoutDefinition) = scheme.levelForZoom(output.maxZoom.get)
zoom -> resizingTileRDD(reprojected, floatMD, layoutDefinition)

Expand Down