GetComponent [?, ProjectedExtent]:(?=> TilerKeyMethods [K,K2])和SpatialComponent:Boundable是什么意思?

时间:2018-10-31 17:23:37

标签: scala apache-spark geotrellis

def fromRdd[
    K: GetComponent[?, ProjectedExtent]: (? => TilerKeyMethods[K, K2]),
    V <: CellGrid,
    K2: SpatialComponent: Boundable
  ](rdd: RDD[(K, V)],  scheme: ZoomedLayoutScheme):
    (Int, TileLayerMetadata[K2]) =
      _fromRdd[K, V, K2](rdd, scheme, None)

在FromRdd的定义中,我无法理解K,V和K2。我知道它们都是隐式参数。但是GetComponent [?, ProjectedExtent]:(?=> TilerKeyMethods [K,K2])和SpatialComponent:Boundable是什么意思?有人可以帮我一个忙吗?非常感谢。

1 个答案:

答案 0 :(得分:0)

这类表达式称为Context Bounds

  • GetComponent只是镜头类型类,在这种特殊情况下,意味着类型K具有允许我们 get {{1} },从这个ProjectedExtent类型的对象开始。

  • K是一个类型类,它允许在TilerKeyMethods键和布局键之间transform

  • ProjectedExtentSpatialComponent是两种镜头类型的两种类型别名:TemporalComponentComponent[K, SpatialKey]

  • Component[K, TemporalKey]是具有比较功能的类型类。

让我知道是否足够满足您的需求,您也可以随时在我们的GeoTrellis gitter频道中发布问题。我强烈建议您逐步学习GeoTrellis docs,并熟悉Scala语言概念,以便更好地理解此代码。