
geotrellis.spark.TemporalKey.scala Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of geotrellis-spark_2.11 Show documentation
Show all versions of geotrellis-spark_2.11 Show documentation
GeoTrellis is an open source geographic data processing engine for high performance applications.
The newest version!
package geotrellis.spark
import geotrellis.spark.io.json.Implicits._
import com.github.nscala_time.time.Imports._
import spray.json._
object TemporalKey {
def apply(dateTime: DateTime): TemporalKey =
TemporalKey(dateTime.getMillis)
implicit def dateTimeToKey(time: DateTime): TemporalKey =
TemporalKey(time)
implicit def keyToDateTime(key: TemporalKey): DateTime =
key.time
implicit def ordering[A <: TemporalKey]: Ordering[A] =
Ordering.by(tk => tk.instant)
}
/** A TemporalKey designates the temporal positioning of a layer's tile. */
case class TemporalKey(instant: Long) {
def time: DateTime = new DateTime(instant, DateTimeZone.UTC)
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy