Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed the issue that vrt.xml is empty when written out #3544

Closed
wants to merge 1 commit into from
Closed

Fixed the issue that vrt.xml is empty when written out #3544

wants to merge 1 commit into from

Conversation

dingsl-giser
Copy link
Contributor

Add writer.flush() when writing xml to vrt, fix the problem of writing empty vrt.xml when writing out COG.

Fixed the issue that the generated vrt.xml is empty when writing out COG
@pomadchin pomadchin added the bug label Jul 8, 2024
Copy link
Member

@pomadchin pomadchin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thanks for the fix! There is a minor comment to address tho around formatting, rather than that LGTM.

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

writer.flush()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! I wonder how did it work before (:

Comment on lines 30 to +46
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
*/
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could u revert these changes and preserve the original fmt?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants