scalaapache-sparkrddprojectiongeotrellis

How to reproject an RDD containing raster to different crs (WGS84)?


i have created an RDD which contains the DGM raster for a particular area and has crs : EPSG 32632. i want to overlay this data over a image for further analysis which has crs:EPSG 4326 which is also an RDD.

Although both the images lie over each other in QGIS but the projection system and there are extents are different that's why later when i try to reproject both RDD to webmercator it gives me a black image.

val (_,inputrdd) : (Int, MultibandTileLayerRDD[SpatialKey]) = biggis.landuse.spark.s3.layerFromS3(bucket, name, Some(tileSize))

   val store = new S3AttributeStore(bucket,name){
    override def s3Client = s3ClientURL()
  }
  val writer = S3COGLayerWriter(store)
  val (_,rasterrdd) : (Int, MultibandTileLayerRDD[SpatialKey]) = biggis.landuse.spark.s3.layerFromS3(bucket1, name1, Some(tileSize))

  val raster_store = new S3AttributeStore(bucket1,name1){
    override def s3Client = s3ClientURL()
  }
  val raster_writer = S3COGLayerWriter(raster_store)

inputrdd is with 4326 .

How can i reproject the rasterrdd to inputrdd projection system ?


Solution

  • Since rasterrdd is of a type MultibandTileLayerRDD[K] you can use all geotrellis functions to perform reprojection; it will be smth like:

    rasterrdd.reproject(LatLng, ZoomedLayoutScheme)
    

    You're welcome to look for a more detailed information into docs and to join our gitter channel for any further questions and discussions.