Due to the fact that RDD is invariant, it is pretty hard and inconvenient to use:
// explicit upcast
val sourceRDD: RDD[RasterSource] = sc.parallelize(files).map(GeoTiffRasterSource(uri).reproject(targetCRS): RasterSource)
val summary = RasterSummary.fromRDD(sourceRDD)
What could be nice is to allow subtypes of the RDD to be accepted by RasterSummary methods:
// with no explicit upcast
val sourceRDD = sc.parallelize(files).map(GeoTiffRasterSource(uri).reproject(targetCRS))
val summary = RasterSummary.fromRDD(sourceRDD)
At this point the
RasterSummary.fromRDD
(and similar methods) have the folowing signature:Due to the fact that RDD is invariant, it is pretty hard and inconvenient to use:
What could be nice is to allow subtypes of the
RDD
to be accepted byRasterSummary
methods:We can work around RDD invariance by defining the following functions singnature (just an example):