
geotrellis.spark.io.file.KeyPathGenerator.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.10 Show documentation
Show all versions of geotrellis-spark_2.10 Show documentation
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