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

geotrellis.spark.io.file.KeyPathGenerator.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.file

import geotrellis.spark.io.index._

import java.io.File

object KeyPathGenerator {
  def apply[K](catalogPath: String, layerPath: String, keyIndex: KeyIndex[K], maxWidth: Int): K => String = {
    val f = new File(catalogPath, layerPath)
    (key: K) => new File(f, Index.encode(keyIndex.toIndex(key), maxWidth)).getAbsolutePath
  }

  def apply(catalogPath: String, layerPath: String, maxWidth: Int): Long => String = {
    val f = new File(catalogPath, layerPath)
    (index: Long) => new File(f, Index.encode(index, maxWidth)).getAbsolutePath
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy