All Downloads are FREE. Search and download functionalities are using the official Maven repository.

geotrellis.spark.io.index.zcurve.ZSpatialKeyIndex.scala Maven / Gradle / Ivy

Go to download

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