Skip to content

Instantly share code, notes, and snippets.

@lossyrob
Created January 13, 2016 22:06
Show Gist options
  • Save lossyrob/aa7327fe3d94bedc12a7 to your computer and use it in GitHub Desktop.
Save lossyrob/aa7327fe3d94bedc12a7 to your computer and use it in GitHub Desktop.
Hilbert key error
import geotrellis.spark.io.index._
import geotrellis.spark.io.json._
import spray.json._
it("does not throw"){
val k1 = SpaceTimeKey(0, 0, new DateTime(2000,1,1,0,0,0))
val k2 = SpaceTimeKey(0, 0, new DateTime(2015,12,31,11,59,59))
val kb = KeyBounds(k1, k2)
val kim = HilbertKeyIndexMethod(12)
val ki = kim.createIndex(kb)
val ki2 = ki.toJson.compactPrint.parseJson.convertTo[KeyIndex[SpaceTimeKey]]
ki2.indexRanges(kb)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment