
geotrellis.spark.io.index.zcurve.ZSpatialKeyIndex.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.io.index.zcurve
import geotrellis.spark._
import geotrellis.spark.io.index.KeyIndex
import geotrellis.spark.io.index.zcurve._
class ZSpatialKeyIndex(val keyBounds: KeyBounds[SpatialKey]) extends KeyIndex[SpatialKey] {
private def toZ(key: SpatialKey): Z2 = Z2(key.col, key.row)
def toIndex(key: SpatialKey): Long = toZ(key).z
def indexRanges(keyRange: (SpatialKey, SpatialKey)): Seq[(Long, Long)] =
Z2.zranges(toZ(keyRange._1), toZ(keyRange._2))
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy