2017-05-04 36 views

回答

3

对于任何RDD[(K, V])]其中K为Boundable,即有范围的隐含Boundable[K],你可以这样做:

val bounds: KeyBounds[K] = 
    tiles.map({ case (key, _) => KeyBounds(key, key) }).reduce(_ combine _) 

这将工作在SpatialKeySpaceTimeKey,作为GeoTrellis提供的隐Boundable类型类这些类型。所以在你的情况下,

val bounds: KeyBounds[SpatialKey] = 
    tiles.map({ case (key, _) => KeyBounds(key, key) }).reduce(_ combine _) 

将工作。