给定RDD[(SpatialKey, Tile)]中的GeoTrellis,如何计算聚合KeyBounds[SpatialKey]
发布于 2017-05-05 16:23:52
对于K为可边界 (即作用域中有隐式Boundable[K] )的任何Boundable[K],您可以这样做:
val bounds: KeyBounds[K] =
tiles.map({ case (key, _) => KeyBounds(key, key) }).reduce(_ combine _)这将适用于SpatialKey和SpaceTimeKey,因为GeoTrellis为这些类型提供了隐式可边界类型。所以在你的情况下
val bounds: KeyBounds[SpatialKey] =
tiles.map({ case (key, _) => KeyBounds(key, key) }).reduce(_ combine _)会起作用的。
https://stackoverflow.com/questions/43794168
复制相似问题