Skip to content

Commit

Permalink
Fixed the issue that vrt.xml is empty when written out
Browse files Browse the repository at this point in the history
Fixed the issue that the generated vrt.xml is empty when writing out COG
  • Loading branch information
dingsl-giser authored Jul 8, 2024
1 parent cd2230d commit 81b7736
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions store/src/main/scala/geotrellis/store/cog/vrt/VRT.scala
Original file line number Diff line number Diff line change
Expand Up @@ -28,22 +28,22 @@ import scala.xml.{Elem, XML}


case class VRT(
gridBounds: GridBounds[Int],
layout: LayoutDefinition,
extent: Extent,
cellType: CellType,
crs: CRS,
bands: List[Elem]
) {
gridBounds: GridBounds[Int],
layout: LayoutDefinition,
extent: Extent,
cellType: CellType,
crs: CRS,
bands: List[Elem]
) {
lazy val (layoutCols, layoutRows) = gridBounds.width * layout.tileCols -> gridBounds.height * layout.tileRows

lazy val re: RasterExtent = RasterExtent(extent, layoutCols, layoutRows)

/**
* Calculates GeoTransform attributes
*
* TODO: refactor, code style kept to follow GDAL: https://github.com/OSGeo/gdal/blob/9a21e8dcaf36a7e046ee87cd57c8c03812dd20ed/gdal/frmts/sde/sdedataset.cpp
*/
* Calculates GeoTransform attributes
*
* TODO: refactor, code style kept to follow GDAL: https://github.com/OSGeo/gdal/blob/9a21e8dcaf36a7e046ee87cd57c8c03812dd20ed/gdal/frmts/sde/sdedataset.cpp
*/
def geoTransform: (Double, Double, Double, Double, Double, Double) = {
val origin = extent.center

Expand Down Expand Up @@ -172,6 +172,7 @@ object VRT {
doctype = null
)

writer.flush()
baos
}

Expand Down

0 comments on commit 81b7736

Please sign in to comment.