Skip to content

Commit bd835d2

Browse files
committed
saveStitched: return item instead of file
Open-EO/openeo-geopyspark-driver#1111
1 parent c8aab4e commit bd835d2

File tree

1 file changed

+6
-4
lines changed
  • openeo-geotrellis/src/main/scala/org/openeo/geotrellis/geotiff

1 file changed

+6
-4
lines changed

openeo-geotrellis/src/main/scala/org/openeo/geotrellis/geotiff/package.scala

+6-4
Original file line numberDiff line numberDiff line change
@@ -79,10 +79,10 @@ package object geotiff {
7979
)
8080

8181
// ~ SpatialTiledRasterLayer in GeoPySpark but supports compression
82-
def saveStitched(rdd: SRDD, path: String, compression: Compression): Extent =
82+
def saveStitched(rdd: SRDD, path: String, compression: Compression): Item =
8383
saveStitched(rdd, path, None, None, compression)
8484

85-
def saveStitched(rdd: SRDD, path: String, cropBounds: Map[String, Double], compression: Compression): Extent =
85+
def saveStitched(rdd: SRDD, path: String, cropBounds: Map[String, Double], compression: Compression): Item =
8686
saveStitched(rdd, path, Some(cropBounds), None, compression)
8787

8888
def saveStitchedTileGrid(rdd: SRDD, path: String, tileGrid: String, compression: Compression): JList[(String, Extent)] =
@@ -811,7 +811,7 @@ package object geotiff {
811811
path: String,
812812
cropBounds: Option[Map[String, Double]],
813813
cropDimensions: Option[ArrayList[Int]],
814-
compression: Compression): Extent = {
814+
compression: Compression): Item = {
815815
val contextRDD = ContextRDD(rdd, rdd.metadata)
816816

817817
val stitched: Raster[MultibandTile] = contextRDD.stitch()
@@ -838,7 +838,9 @@ package object geotiff {
838838
.withOverviews(NearestNeighbor)
839839

840840
writeGeoTiff(geoTiff, path, gtiffOptions = None)
841-
adjusted.extent
841+
842+
Item(id = UUID.randomUUID().toString, datetime = null, bbox = adjusted.extent,
843+
Collections.singletonMap("openEO", Asset(path)))
842844
}
843845

844846
def saveStitchedTileGrid(

0 commit comments

Comments
 (0)