Last active
February 11, 2020 21:21
-
-
Save metasim/5332ac959d97d9747921197cd4307948 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.apache.spark.sql.SparkSession | |
import geotrellis.raster._ | |
import geotrellis.raster.gdal.GDALRasterSource | |
// implicit val spark = SparkSession.builder(). | |
// master("local[*]").appName("Hit me").getOrCreate() | |
val path = "https://s22s-rasterframes-integration-tests.s3.amazonaws.com/B08.jp2" | |
spark.range(1000).rdd. | |
map(_ => path). | |
flatMap(uri => { | |
val rs = GDALRasterSource(uri) | |
val grid = GridBounds(0, 0, rs.cols - 1, rs.rows - 1) | |
val tileBounds = grid.split(256, 256).toSeq | |
rs.readBounds(tileBounds) | |
}). | |
foreach(r => ()) | |
println("Done.") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment