Skip to content

Instantly share code, notes, and snippets.

View metasim's full-sized avatar
🇺🇦

Simeon H.K. Fitch metasim

🇺🇦
View GitHub Profile
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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.
/*
* This software is licensed under the Apache 2 license, quoted below.
*
* Copyright 2020 Astraea, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* [http://www.apache.org/licenses/LICENSE-2.0]
/*
* This software is licensed under the Apache 2 license, quoted below.
*
* Copyright 2017 Astraea, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* [http://www.apache.org/licenses/LICENSE-2.0]
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
java.lang.AssertionError: assertion failed: unsafe symbol Logger (child of package scalalogging) in runtime reflection universe
at scala.reflect.internal.Symbols$Symbol.<init>(Symbols.scala:184)
at scala.reflect.internal.Symbols$TypeSymbol.<init>(Symbols.scala:3009)
at scala.reflect.internal.Symbols$ClassSymbol.<init>(Symbols.scala:3201)
at scala.reflect.internal.Symbols$StubClassSymbol.<init>(Symbols.scala:3496)
at scala.reflect.internal.Symbols$Symbol.newStubSymbol(Symbols.scala:498)
at scala.reflect.internal.pickling.UnPickler$Scan.readExtSymbol$1(UnPickler.scala:258)
at scala.reflect.internal.pickling.UnPickler$Scan.readSymbol(UnPickler.scala:284)
at scala.reflect.internal.pickling.UnPickler$Scan.readSymbolRef(UnPickler.scala:649)
at scala.reflect.internal.pickling.UnPickler$Scan.readType(UnPickler.scala:417)
import geotrellis.raster.io.geotiff.SinglebandGeoTiff
import org.apache.spark.SparkFiles
import org.apache.spark.sql.SparkSession
import org.locationtech.rasterframes._
import org.locationtech.rasterframes.datasource.geotiff._
object LayerToGeoTiff {
def main(args: Array[String]): Unit = {
implicit val spark = new SparkSession.Builder()
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
def set_dims(parts):
assert(len(parts) is 2, "Expected dimensions specification to have exactly two components")
assert(all([isinstance(p, int) and p > 0 for p in parts]),
"Expected all components in dimensions to be positive integers")
options.update({
"imageWidth": parts[0],
"imageHeight": parts[1]
})
if raster_dimensions is not None: