rasterframes icon indicating copy to clipboard operation
rasterframes copied to clipboard

ML supervised learning generating tiff distort

Open tosen1990 opened this issue 4 years ago • 2 comments

When using(fully filled with data value) tiff toMultibandRaster throws null pointer exception,which I still yet cannot understand why there are some null tile in the RasterFrameLayer. Input geojson Output classified result My rough code

So I think out changing the rf by

    val rr: RDD[(SpatialKey, MultibandTile)] = rf.select(rf.spatialKeyColumn, array($"bd_6")).as[(SpatialKey, Array[Tile])]
      .rdd
      .filter {
        case (_: SpatialKey, b) if b(0) == null ⇒ false  // remove any null Tiles
        case _ ⇒ true
      }
      .map { case (sk, tiles) ⇒
        (sk, MultibandTile(tiles))
      }

And the classified result is distorted, the whole raster is squeezed in upper left direction compared with original one. image It seems the tlm meta doesn't behave correctly and I really cannot explain what causes this weird behavor.

tosen1990 avatar Jan 26 '21 02:01 tosen1990

And I even create a new tlm to generate the tiff,it's better than the one above with only tiles in the right-most and bottom cannot output normally. Code is here image For now,I still cannot figuire out what the point is.

tosen1990 avatar Jan 26 '21 05:01 tosen1990

This can easily reproduce by using demo data L8_LB2-Elkton-VA with tile size 16. The result is: image

tosen1990 avatar Jan 26 '21 16:01 tosen1990